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/sh | |
| STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
| if [[ "$STAGED_FILES" = "" ]]; then | |
| exit 0 | |
| fi | |
| PASS=true |
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
| .mo-tips { | |
| position: fixed; | |
| top: 50%; | |
| left: 50%; | |
| width: 240px; | |
| /*min-height: 100px;*/ | |
| margin-top: -50px; | |
| margin-left: -120px; | |
| background-color: #fff; | |
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
| // ==UserScript== | |
| // @name emulator_touch_events | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author author (uses https://github.com/hammerjs/touchemulator) | |
| // @match http://tampermonkey.net/index.php?version=3.13.4890&ext=G3XV&updated=true | |
| // @match *://*/* | |
| // @grant none | |
| // ==/UserScript== |
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 getLeftMarkIndex (codeStr, idx) { | |
| var leftCS = codeStr.slice(0, idx); | |
| var leftMarkIdx; | |
| var rOpenMark = /[\[\{\(]/; | |
| var rCloseMark = /[\]\}\)]/; | |
| var matchMarks = /([\[\{\(]|[\]\}\)])/; | |
| var matchMap = {']': '[', '}': ']', ')': '('}; | |
| var unpairedCount = 0; | |
| for (var i = leftCS.length - 1; i >= 0; 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
| var p = document.getElementsByTagName("p")[0]; | |
| console.log(p.nodeName); // shows: "P" | |
| p.outerHTML = "<div>This div replaced a paragraph.</div>"; | |
| console.log(p.nodeName); // still "P"; | |
| /* | |
| Feature | Firefox (Gecko) | Chrome | Internet Explorer | Opera Safari | |
| Basic support | 11 (11) | 0.2 | 4.0 | 7 1.3 |
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 log = (function () { | |
| if ( console && typeof console.log === 'function' ) { | |
| if (console.log.bind) { | |
| return console.log.bind(console); | |
| } else { | |
| return $.proxy(console.log, console); | |
| } | |
| } else { | |
| return function () { | |
| var log = window.__im_log = window.__im_log || []; |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>demo</title> | |
| <style> | |
| </style> | |
| </head> | |
| <body> | |
| <p>demo.html</p> |
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 getShengmu = (function () { | |
| var idx = -1; | |
| var MAP = 'ABCDEFGHJKLMNOPQRSTWXYZ'; | |
| var boundaryChar = '驁簿錯鵽樲鰒餜靃攟鬠纙鞪黁漚曝裠鶸蜶籜鶩鑂韻糳'; | |
| if ( !String.prototype.localeCompare ) { | |
| throw Error('String.prototype.localeCompare not supported.'); | |
| } | |
| return function getShengmu(c) { |
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
| /** | |
| * Sample React Native App | |
| * https://github.com/facebook/react-native | |
| */ | |
| 'use strict'; | |
| var React = require('react-native'); | |
| var fs = require('NativeModules').FileSystem; | |
| var { | |
| AppRegistry, |
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 | |
| SLE=/System/Library/Extensions | |
| RM=/bin/rm | |
| PKGUTIL=/usr/sbin/pkgutil | |
| TOUCH=/usr/bin/touch | |
| if (( $UID != 0 )); then | |
| echo This script must be run as root, try \'sudo $0\' | |
| exit 1 |