Skip to content

Instantly share code, notes, and snippets.

View wdalmut's full-sized avatar
💭
Fantasy Land

Walter Dal Mut wdalmut

💭
Fantasy Land
View GitHub Profile
#!/usr/bin/python -O
################################################################################
################################################################################
#
# State-Based Text Merging Algorithm
# For 6.033 Design Project 2
# TA: Katherine Fang
# 9 May 2012
#
@wdalmut
wdalmut / .gitignore
Last active August 29, 2015 14:06
discuss zf stdlib
vendor
<blockquote class="twitter-tweet" lang="en"><p>Scale your web apps using SaltStack to manage software &amp; infra across any cloud provider: <a href="http://t.co/5qag27EACL">http://t.co/5qag27EACL</a> A talk by <a href="https://twitter.com/walterdalmut">@walterdalmut</a></p>&mdash; SaltStack (@SaltStackInc) <a href="https://twitter.com/SaltStackInc/status/471372896514736130">May 27, 2014</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
//
// Multithreaded Hello World server.
//
package main
import (
zmq "github.com/pebbe/zmq4"
"fmt"
@wdalmut
wdalmut / rc4.js
Last active August 29, 2015 14:19 — forked from farhadi/rc4.js
/*
* RC4 symmetric cipher encryption/decryption
*
* @license Public Domain
* @param string key - secret key for encryption/decryption
* @param string str - string to be encrypted/decrypted
* @return string
*/
function rc4(key, str) {
var s = [], j = 0, x, res = '';
# lib/puppet/parser/functions/pw_hash.rb
module Puppet::Parser::Functions
newfunction(:pw_hash, type: :rvalue) do |args|
raise Puppet::ParseError, "pw_hash takes exactly two arguments, #{args.length} provided" if args.length != 2
# SHA512 ($6), default number of rounds (5000)
# rounds could be specified by prepending rounds=<n>$ parameter before the salt, i.e.
# args[0].crypt("$6$rounds=50000$#{args[1]}")
args[0].crypt("$6$#{args[1]}")
end
@wdalmut
wdalmut / config.yml
Created July 1, 2015 06:34
symfony2 doctrine influxdb
doctrine:
dbal:
driver_class: Corley\DBAL\Driver\InfluxDB
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
orm:
@wdalmut
wdalmut / couchdb-bulk-geoname-db.php
Created January 6, 2012 16:53
couchdb bulk operation using geonames database
<?php
$filename = dirname(__FILE__) . '/allCountries.txt';
$file = new SplFileObject($filename ,'r');
$map = array(
0 => 'id',
1 => 'name',
2 => 'asciiName',
3 => 'alternateNames',
4 => 'latitude',
@wdalmut
wdalmut / Date.php
Created January 19, 2012 16:13
Zend Date next day by name - not great but it works...
<?php
class Application_Date
extends Zend_Date
{
public static function nextDay($dayWanted)
{
$weekdays = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday');
if (!in_array($dayWanted, $weekdays)) {
throw new Zend_Exception("'{$dayWanted}' not found in array of possible weekdays");
}
@wdalmut
wdalmut / tree.sh
Created April 14, 2012 10:51
Linux Tree Display (ls tree) - Alias
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'