Skip to content

Instantly share code, notes, and snippets.

View thomasv314's full-sized avatar

Thomas Vendetta thomasv314

View GitHub Profile
@chetan
chetan / yardoc_cheatsheet.md
Last active May 4, 2024 11:12
YARD cheatsheet
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@thomasv314
thomasv314 / block-tor.sh
Created March 21, 2013 16:17
script that adapts mikhailian's implementation of blocking tor nodes... http://mikhailian.livejournal.com/48051.html
#! /bin/bash
# script to block tor nodes
# original credit for this goes to mikhailian: http://mikhailian.livejournal.com/48051.html
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
if [ "${1}" == "" ]; then
@thomasv314
thomasv314 / common-mime-types.json
Created April 19, 2013 17:32
List of common #MIME types found on the internet pretty printed in #JSON.
{
".3dm": "x-world/x-3dmf",
".3dmf": "x-world/x-3dmf",
".a": "application/octet-stream",
".aab": "application/x-authorware-bin",
".aam": "application/x-authorware-map",
".aas": "application/x-authorware-seg",
".abc": "text/vnd.abc",
".acgi": "text/html",
".afl": "video/animaflex",
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@csfrancis
csfrancis / gdb_ruby_backtrace.py
Last active April 24, 2024 05:37
Dump an MRI call stack from gdb
# Updated for Ruby 2.3
string_t = None
def get_rstring(addr):
s = addr.cast(string_t.pointer())
if s['basic']['flags'] & (1 << 13):
return s['as']['heap']['ptr'].string()
else:
return s['as']['ary'].string()
@DavidWittman
DavidWittman / hipchat-relay.go
Last active May 10, 2016 14:37
Room-to-room message relay for Hipchat, with support across accounts.
package main
import (
"flag"
"fmt"
"github.com/andybons/hipchat"
"log"
"os"
"path"
"strings"
@mttdffy
mttdffy / unvalidate.rb
Last active November 17, 2017 19:59
RoR/Mongoid module for removing validations from a model
module Mongoid
module Unvalidate
extend ActiveSupport::Concern
module ClassMethods
# Removes specified validations from existing models for a given field
#
# @param [Symbol] field the field to remove validations from
# @param [Array<Symbol> | Symbol] validations validations to remove from field
@chanj
chanj / AWS Security Resources
Last active June 21, 2021 09:49
AWS Security Resources
INTRO
I get asked regularly for good resources on AWS security. This gist collects some of these resources (docs, blogs, talks, open source tools, etc.). Feel free to suggest and contribute.
Short Link: http://tiny.cc/awssecurity
Official AWS Security Resources
* Security Blog - http://blogs.aws.amazon.com/security/
* Security Advisories - http://aws.amazon.com/security/security-bulletins/
* Security Whitepaper (AWS Security Processes/Practices) - http://media.amazonwebservices.com/pdf/AWS_Security_Whitepaper.pdf
* Security Best Practices Whitepaper - http://media.amazonwebservices.com/AWS_Security_Best_Practices.pdf
@mlgill
mlgill / tmuxp.sh
Last active June 22, 2022 09:43
Execute parallel processes in arbitrary number of tmux panes
#!/bin/bash
# The "tmuxifier"
# Execute parallel processes in an arbitrary number of tmux panes
# This script requires the path to an existing script to
# execute in parallel. Optionally, the number of threads to
# and the name of the tmux session can be input. If threads
# and session name are not entered, threads are determined
# automatically and session names is set to a default.