Skip to content

Instantly share code, notes, and snippets.

@0xdevalias
0xdevalias / _deobfuscating-unminifying-obfuscated-web-app-code.md
Last active July 25, 2024 14:19
Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app code
@mlt
mlt / excel_column.sql
Last active February 5, 2023 18:40
Calculate MS Excel column name from its number in PostgreSQL
CREATE FUNCTION excel_column(col integer)
RETURNS text AS
$BODY$
WITH RECURSIVE t(n, out) AS (
SELECT col/26-(col%26=0)::int, chr((col-1)%26 + 65)
UNION ALL
SELECT n/26-(n%26=0)::int, chr((n-1)%26 + 65) || out FROM t
where n>0
)
SELECT out FROM t where n=0;
@santisbon
santisbon / Search my gists.md
Last active July 18, 2024 08:43
How to search gists.

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@kchristidis
kchristidis / protobuf-serialization.md
Last active April 12, 2024 20:09
Notes on protocol buffers and deterministic serialization (or lack thereof)

There doesn't seem to be a good resource online describing the issues with protocol buffers and deterministic serialization (or lack thereof). This is a collection of links on the subject.

Protocol Buffers v3.0.0. release notes:

The deterministic serialization is, however, NOT canonical across languages; it is also unstable across different builds with schema changes due to unknown fields.

Maps documentation:

Wire format ordering and map iteration ordering of map values is undefined, so you cannot rely on your map items being in a particular order.

@subfuzion
subfuzion / .tmux.conf
Last active August 22, 2023 15:33
My .tmux.conf for tmux 2.1 (with fixes for mouse breakage)
# Inspirations:
# http://mutelight.org/practical-tmux
# http://zanshin.net/2013/09/05/my-tmux-configuration/
# http://files.floriancrouzat.net/dotfiles/.tmux.conf
# http://stackoverflow.com/questions/9628435/tmux-status-bar-configuration
# https://github.com/Lokaltog/powerline
# https://github.com/remiprev/teamocil
# http://superuser.com/questions/74492/whats-the-best-prefix-escape-sequence-for-screen-or-tmux
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
#
@IanHopkinson
IanHopkinson / lxml_examples.py
Created November 24, 2015 19:42
Examples of xpath queries using lxml in python
#!/usr/bin/env python
# encoding: utf-8
import lxml.etree
import lxml.html
import requests
xml_sample = """<?xml version="1.0" encoding="UTF-8"?>
<foo:Results xmlns:foo="http://www.foo.com" xmlns="http://www.bah.com">
<foo:Recordset setCount="2">
@codeinthehole
codeinthehole / user-data.sh
Created August 18, 2014 12:41
Get the value of an EC2 instance's tag
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {
@unixmonkey
unixmonkey / OSX10.8 Mountain Lion Web Developer Setup Instructions
Last active March 3, 2018 19:25
My Personal Setup Instructions from fresh OSX1.8 (Mountain Lion) install:
My Personal Setup Instructions from fresh OSX1.8 (Mountain Lion) install:
Some notes on why I have chosen some of these preferences:
I am primarlily a Ruby web developer, and work on a variety of Ruby and Rails versions and database platforms.
I usually use RVM (http://rvm.beginrescueend.com), but this guide uses [chruby](https://github.com/postmodern/chruby)
I spend most of my day in the Terminal, Atom editor, and a Web Browser, and desire to keep things as simple and stock as possible, but do have certain minor preferences that make my day-to-day interaction with the computer better.
Choose Full-Disk encryption on Install and set a password
Run software update until it cannot find any updates
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@camertron
camertron / measure.rb
Created June 15, 2012 22:48
Measure the memory taken by a Ruby object (by Robert Klemme)
#!/bin/env ruby
# lazy hack from Robert Klemme
module Memory
# sizes are guessed, I was too lazy to look
# them up and then they are also platform
# dependent
REF_SIZE = 4 # ?
OBJ_OVERHEAD = 4 # ?