Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <iomanip>
using namespace std;
void main ()
{
int iNum, i = 0;
while (i < 5)
{
@mando
mando / gist:1686990
Created January 27, 2012 04:29
zlib's being a little bitch
require 'zlib'
d = Zlib::Deflate.new
d.set_dictionary("foo")
s = d.deflate("foo" * 100, Zlib::FINISH)
i = Zlib::Inflate.new
begin
puts "Trying to set dictionary pre-emptively"
i.set_dictionary("foo")
@mando
mando / gist:844324
Created February 25, 2011 19:16
Multiple multiline step?
Feature: Clean up my poops
Scenario: multiple poops
Given a JSON poop like
"""
{
"poop": "magoops"
}
"""
def obfuscate (str, passes)
while passes > 0
lines = str.split()
percent = Random.new.rand(15..20)
line_count = int(percent / lines.length)
lines_end = lines.length - line_count
line_num = Random.new.rand(1..lines_end)
lbegin = line_num
uend = line_num + line_count
until line_num = lines_end
@mando
mando / rails_opener.sh
Created November 9, 2009 17:38
Script to open Rails projects in mvim
#!/bin/bash
find app public config test lib db -name *.erb -o -name *.builder -o -name *.erb -o -name *.rb -o -name *.css -o -name *.js -o -name *.yml -o -name \*.rake | xargs mvim
[root@spacewalk sbin]# service Monitoring restart
Stopping Monitoring ... Stopping TSDBLocalQueue ... [ OK ]
Stopping AckProcessor ... [ OK ]
Stopping Notifier ... [ OK ]
Stopping NotifLauncher ... [ OK ]
Stopping NotifEscalator ... [ OK ]
Stopping GenerateNotifConfig ... [ OK ]
Stopping InstallSoftwareConfig ... [ OK ]
[ OK ]
Starting Monitoring ... Starting InstallSoftwareConfig ... [ OK ]
/**
* This class is utilized as a document class in the mp3player.fla file.
* Once finished, the purpose of the class is to be a portion of a flash
* MP3 player.
* Author: <a href="mailto:[email protected]"> Kristine Orr </a>
* <dl>
* <dt>2008-05-12 v1.0.0</dt><dd>This is version one point zero.</dd>
* </dl>
*/