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

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.
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@guerrerocarlos
guerrerocarlos / middleware.py
Created October 31, 2012 22:47 — forked from strogonoff/middleware.py
Django middleware for cross-domain XHR
from django import http
try:
from django.conf import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
XS_SHARING_ALLOWED_METHODS = settings.XS_SHARING_ALLOWED_METHODS
XS_SHARING_ALLOWED_HEADERS = settings.XS_SHARING_ALLOWED_HEADERS
XS_SHARING_ALLOWED_CREDENTIALS = settings.XS_SHARING_ALLOWED_CREDENTIALS
except AttributeError:
XS_SHARING_ALLOWED_ORIGINS = '*'
@guerrerocarlos
guerrerocarlos / pre-render.js
Created July 12, 2016 19:43 — forked from mef/pre-render.js
proof-of-concept pre-rendering d3.js svgs on the server using node.js and jsdom module.
// pre-render d3 charts at server side
var d3 = require('d3')
, jsdom = require('jsdom')
, fs = require('fs')
, htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>'
jsdom.env({
features : { QuerySelector : true }
, html : htmlStub
, done : function(errors, window) {
@guerrerocarlos
guerrerocarlos / README.md
Created March 18, 2017 18:18 — forked from joyrexus/README.md
Node.js streams demystified

A quick overview of the node.js streams interface with basic examples.

This is based on @brycebaril's presentation, Node.js Streams2 Demystified

Overview

Streams are a first-class construct in Node.js for handling data.

Think of them as as lazy evaluation applied to data.

@guerrerocarlos
guerrerocarlos / ffmpeg-cheatsheet.md
Created May 2, 2019 07:47 — forked from nickkraakman/ffmpeg-cheatsheet.md
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@guerrerocarlos
guerrerocarlos / gist:28ea567af8c8b071d8a97423b8631c39
Created October 20, 2019 09:58 — forked from patrickgalbraith/gist:9538b85546b4e3841864
Javascript dynamic getter, setter using defineProperty
var User = (function () {
function User (id, nam) {
var self = this;
this.id = id;
this.nam = nam;
this.__data = {};
for(var p in self) {
var duracionTrabajos = {
pared: 1000,
piso: 2000
};
var arregloCasas = [
{
paredes: 5,
pisos: 5
},
@guerrerocarlos
guerrerocarlos / dnsovertls.md
Created December 19, 2019 01:00 — forked from uraimo/dnsovertls.md
Configure your Mac to use DNS over TLS
@guerrerocarlos
guerrerocarlos / traceroute.js
Created February 7, 2021 13:48 — forked from liamgriffiths/traceroute.js
traceroute clone in javascript
// sloppy traceroute clone
// inpired by https://blogs.oracle.com/ksplice/entry/learning_by_doing_writing_your
// and made possible by https://www.npmjs.org/package/raw-socket
var raw = require('raw-socket');
var dns = require('dns');
var target = process.argv[2] || '173.230.146.29';
var MAX_HOPS = 64;
var TIME_LIMIT = 5000;