Skip to content

Instantly share code, notes, and snippets.

View nogweii's full-sized avatar
🍀

Nogweii nogweii

🍀
View GitHub Profile
#!/usr/bin/ruby
# Ruby version of dspam-retrain perl script.
# Perl version: http://dspamwiki.expass.de/DspamRetrainScript
# Author: wsr@rushforthnetworks.com
# License: BSD
# Abstract: setup postfix to pipe mail into this script
# so that we may then pass it off to dspam in
# an appropriate way.
#
# dspam-retrain.rb handles spam-user@domain.tld, and
@surrealist
surrealist / log2.txt
Created June 10, 2012 14:10
What has happened in .git folder Part 2 (status, branch, checkout)
(Continued from part 1: https://gist.github.com/2905683)
In this 2nd try,
I had monitored git folder while run these following commands:
C:\git\test> git status
C:\git\test> git branch b1
C:\git\test> git checkout b1
C:\git\test> git add readme.txt
C:\git\test> git commit -m "readme"
@tommorris
tommorris / post.rb
Created October 20, 2012 11:49
simplified version of reverse geocode parse
require "json"
require "open-uri"
class Post
def self.location_label(latitude, longitude)
data = open("http://nominatim.openstreetmap.org/reverse?format=json&lat=#{latitude}&lon=#{longitude}&zoom=18&addressdetails=1").readlines.join("\n")
result = JSON.parse(data)
result_arr = []
# london mode
@mark-cooper
mark-cooper / pragpub.pl
Created November 17, 2012 18:29
Download PragPub magazine
use URI;
use URI::URL;
use Web::Scraper;
use LWP::Simple;
my $pp = "http://pragprog.com/magazines";
my $ok = "epub";
my $mags = scraper {
process "span.link", "mags[]" => scraper {
@jumanjiman
jumanjiman / spec_helper.rb
Created February 9, 2013 19:25
demo how to use rspec-hiera-puppet to load hiera.yaml when using dynamic puppet environments
original_verbosity = $VERBOSE
$VERBOSE = nil
require 'rspec-puppet'
require 'rspec-hiera-puppet'
require 'test/unit'
require 'mocha/setup'
module Helpers
extend RSpec::SharedContext
def hiera_config_file
PonyOS
http://www.ponyos.org/
Blizzard - Starcraft : Warhound is back
https://us.battle.net/sc2/en/blog/9369235
Atlassian - JIRA Jr
http://www.atlassian.com/jirajr/
Lambda The Ultimate - Migration to Facebook
@txus
txus / .pryrc.rb
Last active December 18, 2015 17:59
Pry command to trace a method invocation and log backtraces of each invocation to a file.
def write_backtrace name, backtrace, filename
exceptions = Regexp.union([
/\.bundle/,
/spec/,
/test/,
/lib\/ruby\/1.9.1/
])
backtrace.reject! { |line| line =~ exceptions }
#!/bin/sh
# Setup some variables needed for bootstrapping the environment
ROOT=/home/vrde/projectz/myproject
REPOS=${ROOT}/repos
export PYTHONPATH=${REPOS}
@jaryl
jaryl / spec_helper.rb
Created September 13, 2013 18:53
SpecHelper configuration for sending coverage reports to Coveralls and CodeClimate.
require 'codeclimate-test-reporter'
require 'simplecov'
require 'coveralls'
formatters = [SimpleCov::Formatter::HTMLFormatter]
formatters << Coveralls::SimpleCov::Formatter if ENV['COVERALLS_REPO_TOKEN']
formatters << CodeClimate::TestReporter::Formatter if ENV['CODECLIMATE_REPO_TOKEN']
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[*formatters]
#!/bin/sh
initializeANSI()
{
esc=""
Bf="${esc}[30m"; rf="${esc}[31m"; gf="${esc}[32m"
yf="${esc}[33m" bf="${esc}[34m"; pf="${esc}[35m"
cf="${esc}[36m"; wf="${esc}[37m"