Skip to content

Instantly share code, notes, and snippets.

View guerrerocarlos's full-sized avatar
:octocat:
On shoulders of giants.

Carlos Guerrero guerrerocarlos

:octocat:
On shoulders of giants.
View GitHub Profile
@guerrerocarlos
guerrerocarlos / post-receive
Created January 13, 2014 21:15
Development Server - Git Repository Hook - Automatic Deployment
unset GIT_DIR
cd ..
git merge master
git push origin master
@guerrerocarlos
guerrerocarlos / proxydns.py
Last active February 27, 2018 13:25
Local DNS Mirror Server with custom UDP port connection to master ProxyDNS server. This script should help users who's ISP do not allow them to use of external DNS services. By running this script in a local computer, and defining that computer's IP to the rest of the devices, all devices will be able to use ProxyDNS.
from twisted.names import dns, server, client, cache
from twisted.application import service, internet
from twisted.internet import defer
from twisted.python import log
import socket
PROXYDNS_MASTER = '50.116.28.138'
PROXYDNS_PORT = 5353
def show_instructions():
@guerrerocarlos
guerrerocarlos / gist:a624b92bd6d87bb77bb6
Created May 21, 2014 20:26
iMovie Bug: won't load sound from some .mp4 files when importing. Use this line to convert them all to .mov in the most efficient way.
find . -name "*.mp4" -exec ffmpeg -i {} -acodec copy -vcodec copy -f mov {}.mov \;
@guerrerocarlos
guerrerocarlos / reduce.js
Created May 28, 2014 21:40
functional-javascript-workshop recursion exercise solution
function reduce(arr, func, initv){
if (!arr.length) return initv
else return reduce(arr.slice(1), func, func(initv, arr[0]))
}
module.exports = reduce
@guerrerocarlos
guerrerocarlos / duckCount.js
Created May 28, 2014 23:20
functional-javascript duckCount solution
function duckCount(){
function Count(args,pos,count){
if(pos<args.length) return Count(args,pos+1,count + Object.prototype.hasOwnProperty.call(args[pos], "quack") ? 1 : 0)
else return count
}
return Count(arguments,0,0);
}
module.exports = duckCount

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
@guerrerocarlos
guerrerocarlos / create_icns
Created June 30, 2014 22:03
Script to create .icns for MacOSX Apps
mkdir MyIcon.iconset
sips -z 16 16 Icon1024.png --out MyIcon.iconset/icon_16x16.png
sips -z 32 32 Icon1024.png --out MyIcon.iconset/[email protected]
sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_32x32.png
sips -z 64 64 Icon1024.png --out MyIcon.iconset/[email protected]
sips -z 128 128 Icon1024.png --out MyIcon.iconset/icon_128x128.png
sips -z 256 256 Icon1024.png --out MyIcon.iconset/[email protected]
sips -z 256 256 Icon1024.png --out MyIcon.iconset/icon_256x256.png
sips -z 512 512 Icon1024.png --out MyIcon.iconset/[email protected]
sips -z 512 512 Icon1024.png --out MyIcon.iconset/icon_512x512.png
@guerrerocarlos
guerrerocarlos / votar.sh
Last active August 29, 2015 14:03
Que gane el mejor, y tal.
while [ 1 ]
do
curl --form "id=174" http://www.elmuseodelacreatividad.com/votacion/?id=174
curl --data "id=174" http://www.elmuseodelacreatividad.com/votacion/?id=174
sleep 120
done
@guerrerocarlos
guerrerocarlos / create_ico.sh
Created July 17, 2014 04:58
Create multisized .ico in MacOSX
convert icon.png \
\( -clone 0 -resize 16x16 \) \
\( -clone 0 -resize 32x32 \) \
\( -clone 0 -resize 48x48 \) \
\( -clone 0 -resize 64x64 \) \
-delete 0 -colors 256 favicon2.ico
@guerrerocarlos
guerrerocarlos / copyInstallers.sh
Created July 17, 2014 06:10
TorrenTV Installers Copying procedure
find torrentv/build/releases -name "*.gz" -exec cp {} Installers/ \;
find torrentv/build/releases -name "*.exe" -exec cp {} Installers/ \;
find torrentv/build/releases -name "*.zip" -exec cp {} Installers/ \;
find torrentv/build/releases -name "*.dmg" -exec cp {} Installers/ \;