Skip to content

Instantly share code, notes, and snippets.

/**
* 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:kristinester@gmail.com"> Kristine Orr </a>
* <dl>
* <dt>2008-05-12 v1.0.0</dt><dd>This is version one point zero.</dd>
* </dl>
*/
[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 ]
@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
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 / 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"
}
"""
@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")
#include <iostream>
#include <iomanip>
using namespace std;
void main ()
{
int iNum, i = 0;
while (i < 5)
{
#include <iostream>
#include <iomanip>
using namespace std;
void main ()
{
int iNum, i = 0;
while (i < 5)
{
cout << "Please enter a number: ";
@mando
mando / gist:2579040
Created May 2, 2012 18:34
Mappings and such
[~]$ curl -XDELETE 'http://localhost:9200/tumblr' [ruby-1.9.3-p194@lab]
{"ok":true,"acknowledged":true}%
[~]$ cat mapping.json [ruby-1.9.3-p194@lab]
{ "mappings": {
"text": {
"properties": {
"blog_name": {"type": "string", "index":"not_analyzed"},
"timestamp": {"type": "date"}
}
},
@mando
mando / gist:3815988
Created October 2, 2012 03:27
Time Zones say WHA?
$ rails -v
Rails 3.2.8
$ rails c
Loading development environment (Rails 3.2.8)
1.9.3-p194 :001 > Time.zone = 'Paris'
=> "Paris"
1.9.3-p194 :002 > t = Time.zone
=> (GMT+01:00) Paris # HUH? Paris is GMT+02:00 right now, thanks to DST
Now deep in the bowels of ActiveSupport::TimeZone, we have the following: