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
#! /usr/bin/env perl | |
use strict; | |
use warnings; | |
# NOTE http://xkcd.com/1179/ | |
my $d = '02-05-2012 15:50:23'; # => 2012-05-02 15:50:23 | |
my ( $date, $time ) = split( ' ', $d ); |
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
jpn $ # What will the script do | |
jpn $ cat Node/filesystem2.js | |
var fs = require(‘fs’), | |
stdin = process.stdin, | |
stdout = process.stdout; | |
stdin.resume(); | |
stdin.on(‘data’, function(chunk) { | |
fs.appendFile( ‘/tmp/hello’, chunk, |
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
FROM ubuntu | |
MAINTAINER Jose Pinheiro Neta <jose.neta@gmail.com> | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe multiverse restricted" > /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get upgrade -y | |
RUN apt-get install -y build-essential | |
RUN apt-get install -y vim |
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
## Installation | |
# | |
# cd /dir/where/this/dockerfile/is && sudo docker build -rm -t -i 'you/name-it' | |
# | |
FROM ubuntu | |
MAINTAINER Jose Pinheiro Neta <jose.neta@gmail.com> | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list |
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
#! /usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
{ | |
package Beach; | |
use Moo; | |
use Try::Tiny; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
time \ | |
for CAT in dental-surgery-cases cosmetic-surgery-cases nutrition-cases \ | |
psychology-cases clinical-cases; do \ | |
mkdir $CAT && cd $CAT; for ITER in {1..10}; do \ | |
lwp-request -H"Host: www.whitelifedesign.com" \ | |
-H"Referer: www.whitelifedesign.com/cases/$CAT/" \ | |
http://www.whitelifedesign.com/cases/$CAT/page/$ITER > p$ITER.html; \ | |
perl -M"feature 'say'" -MData::Dumper -0 -nwe \ | |
'my $re = qr{<span class="clip">.*?src="(.*?)".*?</span>}s; my @matches = $_ =~ /$re/g; say for @matches' \ | |
p$ITER.html; done | sort | uniq | xargs wget; cd ..; done |
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
#! /usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use Data::Dumper; | |
my $data; | |
{ |
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
;// A way of creating a list of step to feed phantomjs | |
(function(){ | |
steps = [{ | |
'action' : function(args){ | |
console.log( 'hello, here are my params: ', args.join(' ') ); | |
}, | |
'params' : { | |
'alpha' : 'a', | |
'bravo' : 'c', | |
'delta' : 'd' |
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
; // Varzim Lazer Scraper | |
(function(){ | |
var system = require('system') | |
, fs = require('fs') | |
; | |
var page = require('webpage').create(), | |
url= 'http://www.varzimlazer.com/natacao/', | |
location_regex = new RegExp(url) |
OlderNewer