Skip to content

Instantly share code, notes, and snippets.

View FernandoDoming's full-sized avatar

Fernando Domínguez FernandoDoming

View GitHub Profile
@hasherezade
hasherezade / main.cpp
Last active January 31, 2024 11:56
Get PEB64 from a WOW64 process
#include <Windows.h>
#include <iostream>
#include "ntdll_undoc.h"
PPEB get_default_peb()
{
#if defined(_WIN64)
return (PPEB)__readgsqword(0x60);
#else
@mak
mak / x.sh
Created March 7, 2017 12:19
one-liner to extract powershell command in recent nymaim's documnets
( olevba $document | grep ' = ' | \
sed -e's/&/+/g' -e's/NaN/None/g' -e's/ = [^A].*(\(A.*)\))/= \1/' -e 's/Array//' \
-e's/(/[/g' -e's/)/]/g' -e "s#\"\([^\"]*\)\"\([^\"]*\)\"#\"\1'\2#" | \
grep '\[\|\+'; \
echo 'print globals()[sorted(globals(),key=lambda x: type(globals()[x]) == str and len(globals()[x]))[-1]]'
) \
| python2 - | tr -d '^' | tr '[:upper:]' '[:lower:]'
@FernandoDoming
FernandoDoming / pry.py
Created September 8, 2016 12:02
Python's binding pry equivalent
import code; code.interact(local=dict(globals(), **locals()))
@FernandoDoming
FernandoDoming / run_test.sh
Created September 8, 2016 12:02
Run a single test file in Rails
bundle exec ruby -Itest path/to/test/file.rb
@mcasimir
mcasimir / static_map_helper.rb
Created May 24, 2012 01:32
Google Maps Static map helper for Ruby on Rails
module StaticMapHelper
def static_map_for(location, options = {})
params = {
:center => [location.lat, location.lng].join(","),
:zoom => 15,
:size => "300x300",
:markers => [location.lat, location.lng].join(","),
:sensor => true
}.merge(options)