Skip to content

Instantly share code, notes, and snippets.

mshock

  • San Francisco, CA
Block or report user

Report or block mshock

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
anonymous
anonymous / GAME_MASTER_v0_1.protobuf
Created Jul 16, 2016
Pokemon Go decoded GAME_MASTER protobuf file v0.1
View GAME_MASTER_v0_1.protobuf
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
View raspberry-pi-vpn-router.md

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 Mar 30, 2019
Captures screen from Android device via ADB and makes a 180x320 GIF
View android-screen-to-gif.sh
#!/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() {
View .phoenix.js
/*
▄███████▄ ▄█ █▄ ▄██████▄ ▄████████ ███▄▄▄▄ ▄█ ▀████ ▐████▀
███ ███ ███ ███ ███ ███ ███ ███ ███▀▀▀██▄ ███ ███▌ ████▀
███ ███ ███ ███ ███ ███ ███ █▀ ███ ███ ███▌ ███ ▐███
███ ███ ▄███▄▄▄▄███▄▄ ███ ███ ▄███▄▄▄ ███ ███ ███▌ ▀███▄███▀
▀█████████▀ ▀▀███▀▀▀▀███▀ ███ ███ ▀▀███▀▀▀ ███ ███ ███▌ ████▀██▄
███ ███ ███ ███ ███ ███ █▄ ███ ███ ███ ▐███ ▀███
███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄███ ███▄
▄████▀ ███ █▀ ▀██████▀ ██████████ ▀█ █▀ █▀ ████ ███▄
@mshock
mshock / julian2ymd.pl
Created Apr 21, 2013
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)
View julian2ymd.pl
# 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 Feb 26, 2013
permalink to my gravatar image
View gravatar.html
<img src='
http://www.gravatar.com/avatar/ab623233b6a75fecb24a28b6cf2013b7.png
'
alt='cheshire_avatar'>
@mshock
mshock / julianify.pl
Created Feb 9, 2013
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
View julianify.pl
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 Nov 1, 2012
Perltidy options config file
View perltidy.conf
# 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 Oct 11, 2015
sql convert to julian
View sql_julian.sql
select (CONVERT([int],@Date_,(0))+(2415021))
@mshock
mshock / RoundSigFig.sql
Last active Oct 11, 2015
sql function - round float to sig fig
View RoundSigFig.sql
GO
CREATE FUNCTION RoundSigFig(@Number float, @Figures int)
RETURNS float
AS
BEGIN
DECLARE @Answer float;
SET @Answer = (
SELECT
You can’t perform that action at this time.