Skip to content

Instantly share code, notes, and snippets.

View jose-neta's full-sized avatar

José Neta jose-neta

View GitHub Profile
@jose-neta
jose-neta / 0_reuse_code.js
Created February 2, 2014 17:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@jose-neta
jose-neta / x-hipchat
Last active August 29, 2015 14:10 — forked from melo/x-hipchat
#!/usr/bin/env perl
use strict;
use warnings;
use JSON 'encode_json';
use HTTP::Tiny;
use Getopt::Long;
use Encode 'decode';
my %opts = (room => $ENV{HIPCHAT_ROOM}, notify => 1);
#!perl
use warnings;
use strict;
use Benchmark qw( cmpthese );
my $h0 = {
'h1' => {
'h2' => {
#!perl
use warnings;
use strict;
use Benchmark qw( timethese );
my ( $preinc, $postinc ) = ( 0, 0 );
timethese(100_000_000, {
#!perl
# source: http://www.perlmonks.org/?node_id=575918
use warnings;
use strict;
use Benchmark;
timethese(1_000_000, {
#!perl
# source: http://www.perlmonks.org/?node_id=575918
use warnings;
use strict;
use Benchmark;
timethese(1_000_000, {
@jose-neta
jose-neta / Dockerfile
Created October 16, 2015 13:30 — forked from benschw/Dockerfile
MySQL Docker Container
FROM ubuntu
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get -y install mysql-client mysql-server

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@jose-neta
jose-neta / bitbucket.js
Created October 6, 2016 23:49 — forked from webaware/bitbucket.js
Some bookmarklets for setting tab-size to 4 on GitHub, Gist, and Bitbucket. NB: they all work in Chrome, but the GitHub and Gist ones don't work in Firefox (as at v31) because of its implementation for honouring CSP headers.
javascript:(function(){var style=document.createElement('style'),css=document.createTextNode('.refract-container .source{-moz-tab-size:4;tab-size:4;}');style.appendChild(css);document.getElementsByTagName('head')[0].appendChild(style);})();