This file contains 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
/** | |
* Injects the CSS into the <head> DOM node. | |
* | |
* @param {String} css CSS string to add to the <style> tag. | |
* @param {Document} doc document instance to use. | |
*/ | |
function loadStyles(css, doc) { | |
// default to the global `document` object | |
if (!doc) doc = document; |
This file contains 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
.glitch{ | |
color:white; | |
font-size:100px; | |
position:relative; | |
width:400px; | |
margin:0 auto; | |
} | |
@keyframes noise-anim{ | |
$steps:20; | |
@for $i from 0 through $steps{ |
This file contains 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
on run {input, parameters} | |
do shell script "" with administrator privileges | |
set the rootPwd to text returned of (display dialog "请输入您的管理员密码:" default answer "" with hidden answer) | |
try | |
do shell script "echo " & rootPwd & "|sudo -S killall coreaudiod" | |
do shell script "echo " & rootPwd & "|sudo -S kextunload /System/Library/Extensions/AppleHDA.kext" | |
do shell script "echo " & rootPwd & "|sudo -S kextload /System/Library/Extensions/AppleHDA.kext" | |
do shell script "sudo -k" --logout root | |
display dialog "操作已经成功完成,您的系统应该能够恢复声音。 | |
如果问题依旧,请直接重启系统。" buttons {"好"} with icon 1 with title "成功" |
This file contains 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
alias fixow='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"' |
This file contains 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
'.source.ruby': | |
'describe (String)': | |
'prefix': 'des' | |
'body': 'describe "${1:subject}" do\n $0\nend' | |
'describe (type)': | |
'prefix': 'dest' | |
'body': 'describe ${1:Type} do\n $0\nend' | |
'describe (type, string)': | |
'prefix': 'dests' | |
'body': 'describe ${1:Type}, "${2:description}" do\n $0\nend' |
This file contains 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 template = 'hi'; | |
exports.run = function(){ | |
template('hi') | |
} | |
exports.template = function(hi){ | |
console.log(hi) | |
} |
This file contains 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://getfirebug.com/wiki/index.php/Console_API | |
// https://developers.google.com/chrome-developer-tools/docs/console-api#consolelogobject_object | |
// https://developer.mozilla.org/en-US/docs/Web/API/console | |
console.log("%cRed text, %cgreen text, %cblue text", "color:red", "color:green", "color:blue"); | |
console.log("%c", | |
"font-size: 1px; padding: 130px 232px; line-height: 260px;background: url(http://i.imgur.com/oGiMR.gif); background-size: 464px 260px; color: transparent;") | |
This file contains 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 fs = require("fs"); | |
var path = require("path"); | |
// mian code, 请替换路径地址 | |
ncp('./path/to/source', './path/to/dest', function(){ | |
rmrf('./path/to/source'); | |
}) | |
// copy from ncp, 请折叠 | |
function ncp (source, dest, options, callback) { |
This file contains 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
<script type="text/javascript"> | |
var disqus_shortname = 'madscript'; // required: replace example with your forum shortname | |
/* * * DON'T EDIT BELOW THIS LINE * * */ | |
(function() { | |
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; | |
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | |
})(); | |
</script> |
This file contains 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
Object.clone(obj,deep){ | |
if(obj == null || typeof(obj) != 'object') | |
return obj; | |
if(deep){ | |
var temp = obj.constructor(); // changed | |
for(var key in obj) | |
temp[key] = clone(obj[key]); | |
return temp; | |
}else{ |
NewerOlder