Skip to content

Instantly share code, notes, and snippets.

View jespada's full-sized avatar

jespada jespada

View GitHub Profile
@apbendi
apbendi / core_functions_in_depth.clj
Last active October 22, 2021 02:16
Solutions: Clojure for the Brave and True (braveclojure.com)
; In Clojure for the Brave and True (braveclojuure.com),
; at the end of the chapter "Core Functions in Depth", the author
; prevents several challanges to build on top of some sample code
; he has provided
; This code is provided by the author:
;; In ns below, notice that "gen-class" was removed
(ns fwpd.core
;; We haven't gone over require but we will.

My basic point is that currently, configuration management code manifests as a giant, unverifiable pile of mud. The languages we use lack types and are weak at making non-runtime assertions. With the modicum of sanity that a proper module system and types can bring to the table, we would be considerably better off.

@rmehner
rmehner / reinstall-rubies.sh
Created April 6, 2014 14:41
Reinstalls all rbenv rubies. Keeping that here for the regular libyaml update ;-)
for ruby in ~/.rbenv/versions/*; do
rbenv uninstall -f ${ruby##*/}
rbenv install ${ruby##*/}
done
@dysinger
dysinger / boto-with-gnu-parallel.md
Last active August 29, 2015 13:56
Boto w/ GNU-Parallel for Reports & Actions

Using Boto & GNU-Parallel Together

For mass destruction (j/k I mean powerful data gathering)

Useful Prelude of Functions

@dgoguerra
dgoguerra / script-with-options.sh
Last active November 10, 2024 20:00
Manual alternative to getopt in bash scripts, supporting short and long options
#!/usr/bin/env bash
# File name
readonly PROGNAME=$(basename $0)
# File name, without the extension
readonly PROGBASENAME=${PROGNAME%.*}
# File directory
readonly PROGDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Arguments
readonly ARGS="$@"
@joernchen
joernchen / bounty.txt
Created February 22, 2014 16:17
Bounty writeup
GitHub RCE by Environment variable injection Bug Bounty writeup
Disclaimer: I'll keep this really short but I hope you'll get the key points.
GitHub blogged a while ago about some internal tool called gerve:
https://github.com/blog/530-how-we-made-github-fast
Upon git+sshing to github.com gerve basically looks up your permission
on the repo you want to interact with. Then it bounces you further in
another forced SSH session to the back end where the repo actually is.
Ruby 2.1.0 in Production: known bugs and patches
Last week, we upgraded the github.com rails app to ruby 2.1.0 in production.
While testing the new build for rollout, we ran into a number of bugs. Most of
these have been fixed on trunk already, but I've documented them below to help
anyone else who might be testing ruby 2.1 in production.
@naruse I think we should backport these patches to the ruby_2_1 branch and
release 2.1.1 sooner rather than later, as some of the bugs are quite critical.
I'm happy to offer any assistance I can to expedite this process.
{
"title": "Apache and Tomcat Logs",
"services": {
"query": {
"list": {
"0": {
"query": "apache !tomcat !static",
"alias": "",
"color": "#7EB26D",
"id": 0,
@lwf
lwf / gist:8028253
Created December 18, 2013 19:26
whisper-clean.py
import os
import os.path
import sys
from carbon.hashing import ConsistentHashRing
instances = []
unwelcome_instances = []
for arg in sys.argv[1:]:
unwelcome = False
@postmodern
postmodern / gist:7939687
Last active December 31, 2015 05:19
Experiment to see if OptionParser allows options to define other options. Turns out you can!
require 'optparse'
options = OptionParser.new("usage: #{$0}") do |opts|
opts.on('-f','--file FILE','loads a file') do |file|
puts "loading file #{file}"
opts.separator "#{file} options:"
opts.on('-c','--custom') do
puts "custom option defined by file #{file}"
end