Skip to content

Instantly share code, notes, and snippets.

View mrThe's full-sized avatar
🐓

mr.The mrThe

🐓
View GitHub Profile
@stevegraham
stevegraham / gist:833736560d72e15576bd
Last active August 29, 2015 14:04
Grab Instagram cookies
sudo tcpdump -U -In -i en0 -s 2048 -A dst i.instagram.com | ack -o "(?<=Cookie: ).+" --flush > ~/Desktop/cookies
@ervinb
ervinb / debugger-fix.md
Last active August 29, 2015 14:10
Fix debugger installation for any Ruby patchlevel

Use the debugger gem with unsupported Ruby versions

  • replace the version of debugger-ruby_core_source in the path below, with the one you're using
gem install minitar
gem install debugger-ruby_core_source // or install it with bundler
cd ~/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/debugger-ruby_core_source-1.3.7 && rake add_source VERSION=2.0.0-p598 && cd -
@bigjason
bigjason / syntax_highlighting.py
Created September 22, 2011 22:38 — forked from mstarkman/syntax_highlighting.py
Ruby on Rails syntax highlight switcher for Sublime Text 2
import os
from fnmatch import fnmatch
import sublime, sublime_plugin
class DetectFileTypeCommand(sublime_plugin.EventListener):
"""
Detects current file type if the file's extension isn't
Modified for Ruby on Rails and Sublime Text 2 Original pastie
here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa
say -v cellos "Dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo"
## USAGE
#
# ruby rspec-replace.rb spec/**/*_spec.rb
#
## TEST
#
# TEST=1 ruby rspec-replace.rb
#
require 'minitest/unit'
@almog
almog / selenium_cookies_to_mechanize_cookie_jar
Created July 12, 2014 17:12
Selenium cookies to Mechanize CookieJar
@wilmoore
wilmoore / sass_and_less_compared.markdown
Created February 10, 2011 06:17 — forked from chriseppstein/sass_and_less_compared.markdown
Sass/Less Comparison (updated 2011-02-09) -- thanks to chriseppstein for starting this

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For less, I'm using the ruby version because this is what they suggest on the website. The javascript version may be different.

Variables

@rosskevin
rosskevin / db.rake
Last active March 6, 2018 05:02
My db.rake with multi-environment db:rebuild and db:truncate. Some strange behavior in ActiveRecord `database_tasks.rb` adds to the confusion. See this StackOverflow post in the comment.
namespace :db do
# Rake::Task['db:load_config'].enhance [:environment]
desc 'Truncate all tables'
task :truncate => :environment do
puts 'Truncating: '
ActiveRecord::Base.connection.tables.each do |table|
unless %w(schema_migrations rails_admin_histories).include? table
@andrey-kazakov
andrey-kazakov / socksify_faraday.rb
Created February 17, 2012 18:27
HTTP over SOCKS support monkey patch for Mechanize, Faraday and it's based clients (OAuth2 like)
# requires socksify gem
require "socksify"
require 'socksify/http'
# use w/ OAuth2 like OAuth2::Client.new(id, secret, connection_opts: { proxy: 'socks://127.0.0.1:9050' })
class Faraday::Adapter::NetHttp
def net_http_class(env)
if proxy = env[:request][:proxy]
if proxy[:uri].scheme == 'socks'
Net::HTTP::SOCKSProxy(proxy[:uri].host, proxy[:uri].port)
@timruffles
timruffles / attack.md
Last active November 21, 2020 17:35
Chrome/Gmail attack received 11/03/2016. Not sure if the Chrome meta refresh + data:text,html technique is novel.

The following attack will display a "you've been signed out" page for GMail, and attempt to steal your account credentials.

DO NOT PUT ANY ACCOUNT CREDENTIALS INTO ANY TABS CREATED AFTER VISITING THESE LINKS :)

I received an email in my GMail inbox with a fake attachment image, styled to look like the real GMail attachment UI:

fake

This linked to a page that ended up displaying a fake "you've been signed out" link, via the data:text/html... URL feature of Chrome: