Skip to content

Instantly share code, notes, and snippets.

View dennisreimann's full-sized avatar
still hungry. still foolish.

d11n dennisreimann

still hungry. still foolish.
View GitHub Profile
@felixge
felixge / command.sh
Created October 29, 2011 13:43
Bash stuff for fighting a weak DOS attack
# Here a few bash one-liners that helped me analyze / fight a weak DOS attack against debuggable.com. Mostly for future reference.
# The attacker was opening lots of tcp connections without sending data, I believe it's called a SYN flood, see: http://tools.ietf.org/html/rfc4987#section-3.2
# Step 0: Check what is going on at port 80
$ netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c
# Step 1: Increase the number of available fds
$ ulimit -n 32000
# Step 2: Restart your webserver, for me:
@hay
hay / gist:1351230
Last active December 4, 2024 08:11
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Enterprisify your Java Class Names! (by Hay Kranen)</title>
<style>
body {
background: white;
text-align: center;
@roidrage
roidrage / ebooks.md
Created December 2, 2011 15:15
Self-published and awesome
@josevalim
josevalim / 1_README.md
Created December 13, 2011 09:30
FSSM based FileWatcher for Rails

Rails 3.2 ships with a simple FileWatcher that only reloads your app if any of the files changed.

Besides, it also provides a mechanism to hook up your own file watcher mechanism, so we can use tools like FSSM that hooks into Mac OS X fsevents. This is an example on how to hook your own mechanism (you need Rails master, soon to be Rails 3.2):

  1. Copy the 2_file_watcher.rb file below to lib/file_watcher.rb

  2. Add the following inside your Application in config/application.rb

if Rails.env.development?

@dsc8x
dsc8x / Monaco_Linux-Powerline.ttf
Created January 18, 2012 17:19
Monaco for vim-powerline
@kevinSuttle
kevinSuttle / meta-tags.md
Last active April 9, 2025 13:51 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@anthonyshort
anthonyshort / _media-queries.scss
Created March 13, 2012 10:37
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@erotte
erotte / gitcal.rb
Created May 18, 2012 22:38
Simple ruby script for creating ical calendars from local git repos
#! /usr/bin/env ruby
# gitcal.rb
# creates an .ics file from a local git repository and loads it into iCal.app
# Usage: `[bundle exec] ruby gitcal.rb [repo_path] [branch] [count_back]`
# A shell wrapper script maybe a good idea, but for me this works as it is.
require 'grit' # https://github.com/mojombo/grit
require 'ri_cal' # https://github.com/rubyredrick/ri_cal
@rubiii
rubiii / gist:2995814
Created June 26, 2012 13:31
Slow tests are a code smell

Slow tests are a code smell

Measure your test performance with e.g. CI Reporter and refactor slow tests.

  1. Extract domain objects from your fat models. ActiveRecord is not your domain.
  2. Decouple code that doesn't follow the Single Responsibility Principle.
  3. Inject dependencies instead of referring to globals like Rails or User.

From my experience, tests that don't require "test_helper" reveal the coupling in your application.