This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.
publish message to foo
channel from user nickname
.
$ python pub.py foo nickname
PUBLISH to channel #foo
#!/bin/bash | |
# Convert a Github Flavored Markdown Syntax file to HTML | |
# | |
# The MIT License (MIT) | |
# Copyright © 2012 Evertton de Lima <[email protected]> | |
# http://evertton.mit-license.org/ | |
# Stylesheet feature by Dan Untenzu <[email protected]> | |
# | |
# Requirements: cURL (sudo apt-get install curl) |
#!/bin/sh | |
TABLE_SCHEMA=$1 | |
TABLE_NAME=$2 | |
mytime=`date '+%y%m%d%H%M'` | |
hostname=`hostname | tr 'A-Z' 'a-z'` | |
file_prefix="trimax$TABLE_NAME$mytime$TABLE_SCHEMA" | |
bucket_name=$file_prefix | |
splitat="4000000000" | |
bulkfiles=200 |
$ redis-cli | |
> config set stop-writes-on-bgsave-error no |
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
file_to_disk = './tmp/large_disk.vdi' | |
Vagrant::Config.run do |config| | |
config.vm.box = 'base' | |
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
end |
// Convert an interface{} containing a slice of structs into [][]string. | |
func recordize(input interface{}) [][]string { | |
var records [][]string | |
var header []string // The first record in records will contain the names of the fields | |
object := reflect.ValueOf(input) | |
// The first record in the records slice should contain headers / field names | |
if object.Len() > 0 { | |
first := object.Index(0) | |
typ := first.Type() |
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
# file: unzip.py | |
import zipfile,os,sys | |
if len(sys.argv)==2: | |
fname=sys.argv[1] | |
else: | |
print "Usage: python %s filename\n\n" % sys.argv[0] | |
sys.exit() |