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
javascript:(function(){var%20b=document.getElementsByTagName('body')[0];b.innerHTML=b.innerHTML.replace(/\t+|\n+|\r+/g,'');})() |
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
javascript:void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i%3Ca.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')%3E=0&&s.href)%20{var%20h=s.href.replace(/(&|%5C?)forceReload=\d+/,'');s.href=h+(h.indexOf('?')%3E=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}})(); |
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
//Open the file directly in the browser and run this script from the console | |
//Assumptions: The browser uses a <pre/> tag for showing the CSS code | |
var file = document.querySelector("pre"); | |
var fileContent = file.innerHTML; | |
var newContent = fileContent.replace(/([\d.]+)(rem)/g, function(m){ | |
var measure = parseFloat(m.split("rem")[0]); | |
var newMeasure = measure / 1.6; |
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
find myappdir/ -name *.css | xargs grep "px" > ~/Desktop/px-myapp.txt |
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
// CURL | |
var util = require('util'); | |
var exec = require('child_process').exec; | |
// API RESPONSE | |
var http = require('http'); | |
var sys = require('sys'); | |
var server = http.createServer(function(req, res) { | |
res.writeHead(200, { |
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
# Script used for automatically choose remote images files for resolving conflicts in Git | |
# You need your working copy to be in merging status | |
# Define main folders | |
LOG_FOLDER="git_log/" | |
STATUS_FILE=$LOG_FOLDER"raw_status.txt"; | |
BOTH_FILE=$LOG_FOLDER"both_modified.txt"; | |
THEIRS_FILE=$LOG_FOLDER"theirs_modified.txt"; | |
THEIRS_NEWFILE=$LOG_FOLDER"theirs_new.txt"; | |
THEIRS_DELETIONSFILE=$LOG_FOLDER"theirs_deleted.txt"; |
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 | |
diskutil list | |
# Grab your disk location, i'm using /disk2 | |
diskutil unmountDisk /dev/disk2 | |
sudo dd if=/dev/zero of=/dev/rdisk2 bs=1024 | |
sudo dd if=OpenELEC-RPi2.arm-6.0.3.img of=/dev/rdisk2 bs=4m | |
sync | |
diskutil unmountDisk /dev/disk2 |
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 | |
for file in source/*.html.twig; do | |
git mv "$file" "`basename "$file" .html.twig`.tpl.html" | |
done |
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 | |
mv location/module_name location/module_name_2 | |
git submodule deinit -f -- location/module_name | |
git rm -f location/module_name | |
rm -rf location/module_name_2 |
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 fs = require('fs'), | |
request = require('request'); | |
images = require('./images') // Array of images urls | |
var download = function(uri, filename, callback){ | |
request.head(uri, function(err, res, body){ | |
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback); | |
}); | |
}; |
OlderNewer