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
| #! /bin/bash | |
| #define | |
| COLOR_RED="\033[31m"; | |
| COLOR_GREEN="\033[32m"; | |
| COLOR_OFF="\033[0m"; | |
| # if not git repo. output warning | |
| isExistGit=$(ls -a | grep ".git$") | |
| if [ -z "$isExistGit" ] |
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
| function base64Img2Blob(code){ | |
| var parts = code.split(';base64,'); | |
| var contentType = parts[0].split(':')[1]; | |
| var raw = window.atob(parts[1]); | |
| var rawLength = raw.length; | |
| var uInt8Array = new Uint8Array(rawLength); | |
| for (var i = 0; i < rawLength; ++i) { | |
| uInt8Array[i] = raw.charCodeAt(i); |
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
| (function (root, factory) { | |
| if (typeof define === 'function' && define.amd) { | |
| // AMD. Register as an anonymous module. | |
| define(factory); | |
| } else if (typeof module === 'object' && module.exports) { | |
| // Node. Does not work with strict CommonJS, but | |
| // only CommonJS-like environments that support module.exports, | |
| // like Node. | |
| module.exports = factory(); | |
| } 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |