Skip to content

Instantly share code, notes, and snippets.

View 46bit's full-sized avatar
🏳️‍🌈

Miki Mokrysz 46bit

🏳️‍🌈
View GitHub Profile
@shinzui
shinzui / connection_fix.rb
Created December 6, 2009 06:18 — forked from defunkt/connection_fix.rb
MySQL automatic reconnect
# If your workers are inactive for a long period of time, they'll lose
# their MySQL connection.
#
# This hack ensures we re-connect whenever a connection is
# lost. Because, really. why not?
#
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar)
#
# From:
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/
@kmile
kmile / xml_parser.rb
Created February 15, 2011 12:53
A small nokogiri xml reader DSL.
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The
# XML Reader is a good way to move a cursor through a (large) XML document fast,
# but is not as cumbersome as writing a full SAX document handler. Read about
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html
#
# Just pass the reader in this parser and specificy the nodes that you are interested
# in in a block. You can just parse every node or only look inside certain nodes.
#
# A small example:
#
@jxson
jxson / README.md
Created February 10, 2012 00:18
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@CocoaBeans
CocoaBeans / gdbinit
Created February 21, 2012 21:58
.gdbinit - A user-friendly gdb configuration file
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file.
#
# REVISION : 7.3 (16/04/2010)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln
#
# FEEDBACK: https://www.reverse-engineering.net
@arirusso
arirusso / expression_timer.rb
Created April 30, 2012 01:51
Ruby methods for protecting against timing attacks
#!/usr/bin/env ruby
#
# Ruby methods for protecting against timing attacks
#
module ExpressionTimer
# a shortcut to ExpressionTimer.send that passes in the object for which this module
# was included
#
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@46bit
46bit / b_upload.rb
Created November 8, 2012 06:28
My shell file uploader. SCPs files but allows for deleting afterwards, randomising names, etc. Ideal for screenshot uploading.
#!/usr/bin/env ruby
require 'optparse'
require 'digest/md5'
require 'net/scp'
require "fileutils"
options = { }
optparse = OptionParser.new do |opts|
opts.banner = "Usage: b_upload [-p|--preserve|-d|--delete-local] file"
@g3d
g3d / netsed.rb
Created November 18, 2012 10:20
Netsed homebrew formula
require 'formula'
class Netsed <Formula
url 'http://silicone.homelinux.org/release/netsed/netsed-1.1.tar.gz'
homepage 'http://www.securiteam.com/tools/5IP022A35W.html'
version '1.1'
md5 'df64a6099370013621489c60fe97a324'
def install
system "make"
@bertspaan
bertspaan / README.md
Created January 2, 2014 15:28
Python script to convert DBF database file to CSV