This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const PORT = 3000; | |
| const SECRET = 'APP_SHARED_SECRET'; | |
| var http = require('http'), | |
| crypto = require('crypto'), | |
| server; | |
| function verifyShopifyHook(req) { | |
| var digest = crypto.createHmac('SHA256', SECRET) | |
| .update(new Buffer(req.body, 'utf8')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var eventName = "visibilitychange"; | |
| if (document.webkitHidden != undefined) { | |
| eventName = "webkitvisibilitychange"; | |
| } else if (document.mozHidden != undefined) { | |
| eventName = "mozvisibilitychange"; | |
| } else if (document.msHidden != undefined) { | |
| eventName = "msvisibilitychange"; | |
| } else if (document.hidden != undefined) { | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| buildProperties = (func) -> | |
| buildGetter = (name) -> | |
| -> @get name | |
| buildSetter = (name) -> | |
| (value) -> @set name, value | |
| for attr in func.prototype.attributeNames | |
| Object.defineProperty func.prototype, attr, | |
| get: buildGetter attr | |
| set: buildSetter attr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @mixin inline-block { | |
| display: -moz-inline-stack; // ff 2 | |
| display: inline-block; | |
| zoom:1; *display: inline; _height: 15px; // ie 6-7 | |
| } |