Skip to content

Instantly share code, notes, and snippets.

View danielpradilla's full-sized avatar

Daniel Pradilla danielpradilla

View GitHub Profile
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@danielpradilla
danielpradilla / index.html
Created June 3, 2015 14:17
d3clock example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 clock Example</title>
<style>
</style>
</head>
<body>
<div id="chart1"></div>
#!/usr/bin/env perl
=head1 Examples
$ tail -f access_log | perl colorize.pl
$ plackup app.psgi 2>&1 | perl colorize.pl
=cut
use strict;
@danielpradilla
danielpradilla / gist:5933205
Created July 5, 2013 09:16
remove from version control
find . -iname ".svn" -print0 | xargs -0 rm -r
svn export /path/to/old/working/copy /path/to/plain/code
@danielpradilla
danielpradilla / table.html
Created October 16, 2013 07:22
Table rows side by side with css
<style>
table{
width:100%;
}
table tr {display:inline}
table tr:nth-child(1){
position:relative;
}
table tr:nth-child(1) td{
position:absolute;
@danielpradilla
danielpradilla / introrx.md
Created February 10, 2016 16:54 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@danielpradilla
danielpradilla / sieve_of_eratosthenes.js
Created March 8, 2017 15:42
Sieve of Eratosthenes
/*jshint esnext: true */
/*
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
1. Create a list of consecutive integers from 2 through n: (2, 3, 4, ..., n).
2. Initially, let p equal 2, the smallest prime number.
3. Enumerate the multiples of p by counting to n from 2p in increments of p, and mark them in the list (these will be 2p, 3p, 4p, ...; the p itself should not be marked).
@danielpradilla
danielpradilla / transpose.js
Created October 6, 2018 23:50
transpose-in-javascript
/**
* http://www.codesuck.com/2012/02/transpose-javascript-array-in-one-line.html
*/
function transpose(a) {
return Object.keys(a[0]).map(function (c) {
return a.map(function (r) {
return r[c];
});
});
}
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #