Skip to content

Instantly share code, notes, and snippets.

View fredkelly's full-sized avatar

Freddy Kelly fredkelly

View GitHub Profile
@mildred
mildred / download.sh
Created October 20, 2014 10:03
Download from archive.org Wayback Machine
#!/bin/bash
url=http://redefininggod.com
webarchive=https://web.archive.org
wget="wget -e robots=off -nv"
tab="$(printf '\t')"
additional_url=url.list
# Construct listing.txt from url.list
# The list of archived pages, including some wildcard url
@kimmobrunfeldt
kimmobrunfeldt / 0-osx-for-web-development.md
Last active July 26, 2022 13:30
Install web development tools to Mavericks (OS X 10.9)

Install web development tools to Mavericks (OS X 10.9)

Strongly opinionated set of guides to quickly setup OS X Mavericks for web development. By default OS X hides stuff that normal people don't need to see. These settings are better defaults for developers.

I don't want: any sounds, annoying confirmation dialogs, hidden extensions, superflous animations, unnecessary things running like Dashboard, Notification center or Dock(Alfred/spotlight works better for me).

These are my opinions. Read this document through and pick up the good parts to your preferences.

System preferences

@takeshixx
takeshixx / hb-test.py
Last active March 9, 2024 13:37
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@thebucknerlife
thebucknerlife / authentication_with_bcrypt_in_rails_4.md
Last active January 17, 2024 23:54
Simple Authentication in Rail 4 Using Bcrypt

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps

@peterhellberg
peterhellberg / api.go
Last active January 18, 2019 01:58
A tiny example API written in Go using Martini and Redigo
package main
import (
"flag"
"fmt"
"net/http"
"github.com/codegangsta/martini"
"github.com/garyburd/redigo/redis"
"github.com/martini-contrib/render"
@mojavelinux
mojavelinux / middleman-asciidoctor.adoc
Last active August 29, 2015 13:56
Instructions for configuring AsciiDoc in Middleman 3.

How to enable AsciiDoc in a Middleman 3 site

Follow these steps to setup AsciiDoc in a Middleman 3 site.

Note
Middleman 4 will require the use of the middleman-asciidoc gem.
@MrAlexLau
MrAlexLau / airbrake.rb
Created June 27, 2013 13:25
How to ignore Sidekiq exceptions in Airbrake for a rails project.
#config/initializers/airbrake.rb
Airbrake.configure do |config|
config.api_key = 'mySecretKeyGoesHere'
config.ignore << "CustomSidekiqException" #do not report our custom exceptions to Airbrake
end
@mcls
mcls / rtmp_meta.rb
Created May 14, 2013 14:10
Quick hack to fetch duration of RTMP stream using rtmpdump v2.4.
require 'forwardable'
module RtmpMeta
class Parser
PATTERN = /duration\s+(?<duration>\d+\.?\d+)$/
attr_reader :raw_data
def initialize raw_data
@raw_data = raw_data
end
@gregolsen
gregolsen / gist:5378320
Created April 13, 2013 13:01
simple way to get routes info
require 'rails/application/route_inspector'
all_routes = Rails.application.routes.routes.select { |r| r.defaults[:controller] =~ /api\/v1/ }
inspector = Rails::Application::RouteInspector.new
pp inspector.format(all_routes, 'api/v1/inboxes').map { |x| x.split(' ') }
# [["api_v1_inbox",
# "POST",
# "/api/v1/inboxes/:id(.:format)",
# "api/v1/inboxes#update"],
# ["api_v1_inboxes",
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {})
options[:renderer] ||= FoundationLinkRenderer
super.try :html_safe
end
class FoundationLinkRenderer < LinkRenderer
protected