This file contains 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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
This file contains 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
# Conversão em massa de arquivos shapefiles para geojson usando ogr2ogr | |
# Para mais informações, veja http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/ | |
# Observação: Assumo que você está rodando o script em uma pasta com um ou mais arquivos zipados contendo shapefiles | |
# e a saída será como geojson com crs:84 SRC (para uso no github ou por aí) | |
# conversão em geojson | |
function shp2geojson() { | |
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp" | |
} |
This file contains 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/sh | |
wget "http://www.haproxy.org/download/1.5/src/haproxy-1.5.11.tar.gz" | |
rpmdev-setuptree | |
mv haproxy-1.5.11.tar.gz ~/rpmbuild/SOURCES/ | |
git clone git://github.com/lucaspirola/haproxy-centos.git | |
cp haproxy-centos/conf/* ~/rpmbuild/SOURCES/ | |
cp haproxy-centos/spec/* ~/rpmbuild/SPECS/ | |
cd rpmbuild/ | |
rpmbuild -ba SPECS/haproxy.spec |
This file contains 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
import type from 'type-of-is' | |
export default function parse( input ){ | |
if( type( input, String ) ){ | |
return input | |
} | |
else if( type( input[ 0 ], Array ) ){ | |
return input.map( parse ) | |
} |
This file contains 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 page = require('webpage').create(), | |
url = 'http://example.com/'; | |
// Put the event handlers somewhere in the code before the action of | |
// interest (opening the page in question or clicking something) | |
// http://phantomjs.org/api/webpage/handler/on-console-message.html | |
page.onConsoleMessage = function(msg, lineNum, sourceId) { | |
console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")'); | |
}; |
This file contains 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
import LogmaticJs from 'logmatic-js'; | |
const track = function (verb) { | |
// Event fields | |
const _verb = verb; | |
let _object = null; | |
let _target = null; | |
let _start = null; |
This file contains 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
# Example Dockerfile | |
FROM hello-world |
OlderNewer