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
Config . | |
powercfg /c BaajAlarm | |
powercfg /x BaajAlarm /monitor-timeout-ac 15 | |
powercfg /x BaajAlarm /monitor-timeout-dc 15 | |
powercfg /x BaajAlarm /disk-timeout-ac 15 | |
powercfg /x BaajAlarm /disk-timeout-dc 15 | |
powercfg /x BaajAlarm /standby-timeout-ac 0 | |
powercfg /x BaajAlarm /standby-timeout-dc 0 | |
powercfg /x BaajAlarm /hibernate-timeout-ac 0 |
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
function percentageSeen (id) { | |
var $element = $('#'+id), $win = $(window),viewportHeight = $(window).height(), | |
scrollTop = $win.scrollTop(), | |
elementOffsetTop = $element.offset().top, | |
elementHeight = $element.height(); | |
if (elementOffsetTop > (scrollTop + viewportHeight)) { | |
return 0; |
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
rgb2hsv (r,g,b) -> | |
r=r/255 | |
g=g/255 | |
b=b/255 | |
max = Math.max(r,g,b) | |
min = Math.min(r,g,b) | |
v = max | |
d = max - min |
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
yaml = require('js-yaml'); | |
fs = require('fs'); | |
try { | |
var doc = yaml.safeLoad(fs.readFileSync(process.argv[2], 'utf8')); | |
var nLine = process.argv[2] + ',' | |
+ doc.metadata.audio_properties.length + ',' | |
+ doc.rhythm.bpm + ',' |
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
#!/bin/sh | |
sudo add-apt-repository ppa:webupd8team/atom | |
sudo add-apt-repository ppa:jon-severinsson/ffmpeg | |
sudo add-apt-repository ppa:jerzy-kozera/zeal-ppa | |
sudo apt-get update | |
sudo apt-get install atom | |
sudo apt-get install mongodb | |
sudo apt-get install npm | |
sudo apt-get install node | |
sudo npm install -g coffee-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
var http = require('http'); | |
var url = require("url"); | |
var crypto = require('crypto'); | |
if(process.argv.length != 4) | |
{ | |
console.log('Syntax ::'); | |
console.log('node pagemonitor.js http://my-url-to-monitor.com 300'); | |
console.log('with 300 the interval check (in seconds (300s = 5min)).'); | |
process.exit(1); |
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
setInterval(function(){ | |
var list = document.getElementById("box").getElementsByTagName("span"), bgUsed={}; | |
for (var i = 0, len = list.length; i < len; i++) { | |
var e = list[i].style.backgroundColor; | |
if(Object.keys(bgUsed).length==0){bgUsed[e]=i; continue;} | |
if(!bgUsed.hasOwnProperty(e)) {bgUsed[e]=i; continue; } | |
else if(Object.keys(bgUsed).length > 1) { delete bgUsed[e]; break;} | |
} |
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
import codecs | |
from datetime import datetime | |
import sys | |
from TwitterAPI import TwitterAPI, TwitterOAuth, TwitterRestPager | |
###Supposed you have a large list of username like this in a txt file (here: o.txt) : | |
###@aaaa | |
###@bbbb | |
###@cccc | |
###.... |
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
export PATH=/usr/local/bin:$PATH | |
alias NBContrast="convert $1 -type Grayscale -contrast $2" | |
alias imgdim='sips -g pixelHeight -g pixelWidth $1' | |
alias cx='chmod +x' | |
mcd() { mkdir -p "$1" && cd "$1"; } | |
qre() { qrencode -o /tmp/a.jpg '$1' && open "/tmp/a.jpg" && sleep 1 && rm "/tmp/a.jpg"; } | |
alias l='ls -al' | |
alias dieu='sudo su root -s /bin/zsh' | |
alias fuck='sudo su root -s /bin/zsh' | |
export iOSOpenDevPath=/opt/iOSOpenDev |
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
find . -type f -name '*.gpx' -print | while read filename; do | |
echo "$filename"; | |
cat "$filename"|grep " <trkpt"|head -n 1; | |
done > output.txt |
OlderNewer