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 ruby | |
# encofing: utf-8 | |
require 'rubygems' | |
require 'nokogiri' | |
page = Nokogiri::HTML(open('/tmp/planetfossil.htm')) | |
feeds = Hash.new |
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 ruby | |
output = open('output', 'w+') | |
lines = open('logfile').readlines | |
open('shortfile').each_line do |l| | |
name = l.chomp | |
output.puts name if lines.include? name | |
end |
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
# run with: rvmsudo god -c /srv/phone/phonzy/current/ahn/config/god/adhearsion.god | |
# debug with: rvmsudo god quit && rvmsudo god -c /srv/phone/phonzy/current/ahn/config/god/adhearsion.god -D | |
@deploy_path = '/srv/phone/phonzy' | |
@shared_path = File.join @deploy_path, 'shared' | |
@app_path = File.join @deploy_path, 'current', 'ahn' | |
@log_path = File.join @shared_path, 'log' | |
@pid_path = File.join @shared_path, 'pids' | |
@pid_file = File.join @pid_path, 'adhearsion.pid' | |
@god_env = YAML.load_file("#{@shared_path}/config/god_environment.yml") |
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
func open_file { | |
f, err := os.Open("/tmp/a_file") | |
if err != nil { | |
log.Fatal("Unable to open a_file") | |
} | |
defer f.Close() | |
// do something here | |
} |
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
" Vim syntax file | |
" Language: SQL | |
" Maintainer: Scott Morgan < blumf7 at gmail dot com > | |
" Last Change: 2014-06-13 | |
" Version: 1.0 | |
" For version 5.x: Clear all syntax items | |
" For version 6.x: Quit when a syntax file was already loaded | |
if version < 600 | |
syntax clear |
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 ruby | |
require 'open-uri' | |
require 'json' | |
PKR_URL = 'http://www.oref.org.il/WarningMessages/alerts.json' | |
AREA_FMT = 'מרחב: %s, קוד מרחב: %s' | |
LOG_FMT = '[%s] id: %s, %s' | |
def to_json |
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
int led = 13; | |
int in = 0; | |
void setup() { | |
pinMode(led, OUTPUT); | |
Serial.begin(9600); | |
} | |
void loop() { | |
if (Serial.available() == 0) { |
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 ruby | |
require 'fileutils' | |
SOURCE = '/tmp/mbox/' | |
DESTINATION = '/tmp/maildir/domain.com/' | |
def is_maildir(path) | |
dirs = Dir[File.join(path, '*')] | |
dirs.select {|name| File.directory?(File.join(path, name)) && |
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
source "https://rubygems.org" | |
gem 'grape' | |
gem 'rack' |
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
/* install postgresql-contrib */ | |
CREATE EXTENSION "uuid-ossp"; | |
select uuid_generate_v4(); |
OlderNewer