Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / GAME_MASTER_v0_1.protobuf
Created July 16, 2016 16:31
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@lorenzos
lorenzos / android-screen-to-gif.sh
Last active March 30, 2019 21:00
Captures screen from Android device via ADB and makes a 180x320 GIF
#!/bin/bash
# How to install:
# exo-open "http://developer.android.com/sdk/index.html#Other"
# sudo apt-get install libav-tools imagemagick
# wget https://gist.githubusercontent.com/lorenzos/e8a97c1992cddf9c1142/raw/android-screen-to-gif.sh
# chmod a+x android-screen-to-gif.sh
# Help message
function usage() {
@mshock
mshock / julian2ymd.pl
Created April 21, 2013 00:36
Perl sub converts a Julian date number (JDN) into its Gregorian year, month, day, components not 100% precise for JDN too far in the past, but seems good for modern dates (algorithm & constants from Wikipedia)
# convert julian date number into Gregorian year, month, day parts
# not precise too far in the past... 1580-something?
sub jdn2greg {
my ($jdate) = @_;
# make sure formatted like JDN (DDDDDDD[.D*])
return if $jdate !~ m/^\d{7}\.?(\d*)$/;
# TODO add support for time here based on fractional day RH side of decimal place
# define conversion constants
my $y = 4716;
@mshock
mshock / gravatar.html
Created February 26, 2013 23:41
permalink to my gravatar image
<img src='
http://www.gravatar.com/avatar/ab623233b6a75fecb24a28b6cf2013b7.png
'
alt='cheshire_avatar'>
@mshock
mshock / julianify.pl
Created February 9, 2013 00:11
Convert a Gregorian calendar date to Julian date number (JDN) in Perl faster, less overhead than using any Date packages from CPAN straight from the Wikipedia algorithm
sub julianify {
my ( $year, $month, $day ) = @_;
my $a = int( ( 14 - $month ) / 12 );
my $y = $year + 4800 - $a;
my $m = $month + 12 * $a - 3;
return
$day
+ int( ( 153 * $m + 2 ) / 5 )
+ 365 * $y
@mshock
mshock / perltidy.conf
Created November 1, 2012 17:02
Perltidy options config file
# mshock's Perltidy options
# Perl Best Practices
# an abbreviation for the parameters in the book Perl Best Practices by Damian Conway:
# -l=78 -i=4 -ci=4 -st -se -vt=2 -cti=0 -pt=1 -bt=1 -sbt=1 -bbt=1 -nsfs -nolq
# -wbb="% + - * / x != == >= <= =~ !~ < > | & =
# **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x="
-pbp
@mshock
mshock / sql_julian.sql
Last active October 11, 2015 21:17
sql convert to julian
select (CONVERT([int],@Date_,(0))+(2415021))
@mshock
mshock / RoundSigFig.sql
Last active October 11, 2015 21:08
sql function - round float to sig fig
GO
CREATE FUNCTION RoundSigFig(@Number float, @Figures int)
RETURNS float
AS
BEGIN
DECLARE @Answer float;
SET @Answer = (
SELECT
@mshock
mshock / ppm_getmods.pl
Created October 11, 2012 20:50
ppm install missing modules from exported csv
#! perl -w
# read exported ppm csv list and install all missing modules
use strict;
# first make sure everything is up to date
print "updating all installed modules...\n";
print `ppm upgrade --install`;
print "\ndone\n\n";