Skip to content

Instantly share code, notes, and snippets.

Thomas Fuchs madrobby

Block or report user

Report or block madrobby

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:7c46687b008bb0e947f0
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 6115 | 4880 | 48 | 436 | 9 | 9 |
| Helpers | 1534 | 1214 | 1 | 175 | 175 | 4 |
| Models | 10394 | 8021 | 106 | 1126 | 10 | 5 |
| Libraries | 2098 | 1519 | 28 | 186 | 6 | 6 |
| Integration tests | 1419 | 1054 | 12 | 6 | 0 | 173 |
| Functional tests | 13650 | 10437 | 28 | 71 | 2 | 145 |
| Unit tests | 21981 | 17809 | 41 | 73 | 1 | 241 |
View gist:c010cd550aa55ecbda1c
<!-- iPhone 6 Plus -->
<link href="startup-image-1242x2148.png"
media="(device-width: 414px) and (device-height: 736px)
and (-webkit-device-pixel-ratio: 3)"
rel="apple-touch-startup-image">
View gist:b428cc58afff0a89c007
def self.carriage_returns_to_newlines!(file_contents)
(file_contents.gsub!(/\r\n/,"\n")||file_contents).gsub!(/\r/, "\n") || file_contents
end
View generate.sh
#!/bin/sh
# This requires "imagemin", install via:
# npm install --global imagemin
echo "Cleaning up..."
rm -rf build
mkdir build
echo "Optimizing SVG..."
imagemin *.svg ../public/images/icons
View generate_icons.rb
#!/usr/bin/env ruby
require 'json'
FILENAME = "../app/helpers/icon_helper.rb"
JAVASCRIPT_HELPER = "../public/js/icons/icons.js"
puts "Generating helper #{FILENAME}"
File.open(FILENAME, 'w') do |helper|
helper.write "module IconHelper\n\n"
View gist:27b537ab0344c827daf8
letters = ""
letters << user.first_name[0,1] if user.first_name.size > 1 && 'A'..'Z'.include?(user.first_name[0,1].upcase)
letters << user.last_name[0,1] if user.last_name.size > 1 && 'A'..'Z'.include?(user.last_name[0,1].upcase)
View gist:da12f6394fa7f2fdf7b0
- name: Symlink release to be current version
sudo: yes
shell: >
rm -f {{ freckle_current_path }} &&
ln -s {{ release_path }} {{ freckle_current_path }}
notify:
- restart unicorn
- restart resque-worker
- restart resque-priority-worker
when: (new_release|changed) and ('appservers' in group_names)
View gist:4445c91a2db63b3a1e6a
OpenSSL Security Advisory [19 Mar 2015]
=======================================
OpenSSL 1.0.2 ClientHello sigalgs DoS (CVE-2015-0291)
=====================================================
Severity: High
If a client connects to an OpenSSL 1.0.2 server and renegotiates with an
invalid signature algorithms extension a NULL pointer dereference will occur.
View gist:5329c625888fa1065b33
<style>
div {
width: 300px;
height: 400px;
position: absolute;
left:50%;
margin-left:-150px;
background: url('data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwcIBwoICAoOCQgJDhENCgoNERQQEBEQEBQTDxEQEBEPExMXFxkXFxMeHiAgHh4sKysrLDExMTExMTExMTH/2wBDAQsJCQsMCw0LCw0RDg4OERQODg4OFBgQEBEQEBgeFhMTExMWHhsdGRkZHRshIR4eISEpKSgpKTExMTExMTExMTH/wgARCAGQASwDASIAAhEBAxEB/8QAHAAAAQUBAQEAAAAAAAAAAAAAAgABAwQFBgcI/9oACAEBAAAAAOWseh5mtrV+a2YfHx6R9e1q95keZh6k1Dr8jaBpHhpQbar+d+N6fs9Lyj2rVo4tPyU+ty9frS7LC81i9hyanWQ7NWhPJNh3NpNX+YpvRO48f77aHl280i6OK9tTelZ/ktT2vmtDeySqRX2t40NyHEi5el1Hp3kk/U4HPXcbC2H6Krpeory2v6zz1vQ4avqWd/K6nnumnzA1/n3k+m9h8k7Opg0rk8xz2LQ2npgnnDOkt3NqDo6u2uZ6WDw2C76TxudZ2LTNGTPLZjTysDSEVerVt6G/rLkdDguMS9gwpSEAJ3mKLU1sR7xxwwnIE8Vatr9Q+blcnyVOafT39OOuSFHo6Fis19sm1Ll1IbW7chxqXZzhy2dy5ZFuxhUrF+7pWdEbG7rV5U+VoAqFeVuZ5rB6j2B8znsKGWply6urJmZehVw6TBLoa2pl2JgJp7efhWbNj06HDwavnlIt+1asSyyS2JZ5Yq0YWqFmUHJDXpxw2PUaXLZtrzS1cFWJppZJCc3JE5IhdOKrVYoNnu+doNhcoG5Zwb1iaQzMykYk5sTIkLU69Wv0t6tz2vgYMW72nn
View gist:29443
sqlite> SELECT * FROM ENTRIES_TAGS WHERE TAG_ID IN (58, 59);
140|58
141|59
142|58
142|59
sqlite> SELECT DISTINCT ENTRIES.ID FROM ENTRIES INNER JOIN ENTRIES_TAGS ON (ENTRIES.ID = ENTRIES_TAGS.ENTRY_ID) WHERE ENTRIES_TAGS.TAG_ID = 59 INTERSECT SELECT DISTINCT ENTRIES.ID FROM ENTRIES INNER JOIN ENTRIES_TAGS ON (ENTRIES.ID = ENTRIES_TAGS.ENTRY_ID) WHERE ENTRIES_TAGS.TAG_ID = 58;
142
You can’t perform that action at this time.