This file contains hidden or 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
require 'scrapify' | |
require 'models' | |
module HN | |
class Scraper < Scrapify::Page | |
encoding 'utf-8' | |
fields = { |
This file contains hidden or 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 Dancer; | |
get '/' => sub { | |
"Hello World!" | |
}; | |
dance; |
This file contains hidden or 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
if ! $(psql template1 -c 'SHOW SERVER_ENCODING' | grep -q UTF8); then | |
psql postgres -c "update pg_database set datallowconn = TRUE where datname = 'template0';" | |
psql template0 -c "update pg_database set datistemplate = FALSE where datname = 'template1';" | |
psql template0 -c "drop database template1;" | |
psql template0 -c "create database template1 with template = template0 encoding = 'UTF8';" | |
psql template0 -c "update pg_database set datistemplate = TRUE where datname = 'template1';" | |
psql template1 -c "update pg_database set datallowconn = FALSE where datname = 'template0';" | |
fi |
This file contains hidden or 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
WshShell = WScript.CreateObject("WScript.Shell") | |
res = WshShell.Popup("Hello World!", 5,undefined , 2 + 48) |
This file contains hidden or 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
sequelize = new Sequelize({'database_name', null, null, | |
dialect: 'postgres', | |
native: true, | |
protocol: 'postgresql', | |
host: null, | |
port: null, | |
}) |
This file contains hidden or 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
jade = require 'jade' | |
fs = require 'fs' | |
coffee = require 'coffee-script' | |
path = require 'path' | |
file = require 'file' | |
watch = (fname)-> | |
fs.watch fname, (event, filename)-> |
This file contains hidden or 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
1.upto(100).each do |i| | |
unless i % 3 == 0 or i % 5 == 0 | |
print i | |
else | |
print 'Fizz' if i % 3 == 0 | |
print 'Buzz' if i % 5 == 0 | |
end | |
puts | |
end |
This file contains hidden or 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
exec = require('child_process').exec | |
exec 'net users', (err, stdout)-> console.log stdout |
This file contains hidden or 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 express = require('express'); | |
var exec = require('child_process').exec; | |
var app = express.createServer(); | |
var fs = require('fs'); | |
var path = require('path'); | |
var jobs = []; | |
app.use(express.bodyParser()); |
This file contains hidden or 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 ruby | |
# 1283314500 EXPORTS NET-A-PORTER LIVE DATA INTO POSTGRESQL | |
require "logger" | |
require "sequel" | |
#require "pgpass" | |
require "fileutils" | |
module NAP |