Skip to content

Instantly share code, notes, and snippets.

Joseph McCullough joequery

View GitHub Profile
@joequery
joequery / sombra_decrypt.php
Last active Oct 19, 2016
sombra decryption
View sombra_decrypt.php
<?php
function str_rot($s, $n = 13) {
static $letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$n = (int)$n % 26;
if (!$n) return $s;
if ($n == 13) return str_rot13($s);
for ($i = 0, $l = strlen($s); $i < $l; $i++) {
$c = $s[$i];
if ($c >= 'a' && $c <= 'z') {
View encrypt.php
<?php
function str_rot($s, $n = 13) {
static $letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$n = (int)$n % 26;
if (!$n) return $s;
if ($n == 13) return str_rot13($s);
for ($i = 0, $l = strlen($s); $i < $l; $i++) {
$c = $s[$i];
if ($c >= 'a' && $c <= 'z') {
@joequery
joequery / diff.diff
Last active Aug 9, 2016
sombra diff
View diff.diff
2049c2049
< 0008000: a8b6 1e2a 45ae 0d4b 2170 d95e ae1c a653 ...*E..K!p.^...S
---
> 0008000: a8b6 1e2a 45ae 0d4b 5070 d95e ae1c a653 ...*E..KPp.^...S
2055c2055
< 0008060: 5b29 1a8f 215a 7926 ca19 ae5e e1d9 4594 [)..!Zy&...^..E.
---
> 0008060: 5b29 1a8f 6f5a 7926 ca19 ae5e e1d9 4594 [)..oZy&...^..E.
2077c2077
< 00081c0: efa4 ead0 958a c633 212d d291 4476 9a00 .......3!-..Dv..
View file1-file2.diff
*** file1.txt 2016-05-27 09:16:35.000000000 -0500
--- file2.txt 2016-05-27 09:17:02.000000000 -0500
***************
*** 1 ****
--- 1,3 ----
+ Dude I'm awesome
Hello, I'm awesome
+ Lol you're awesome too dude
View austin_weather.json
{"latitude":30.3389,"longitude":-97.7707,"timezone":"America/Chicago","offset":-6,"currently":{"time":1449107831,"summary":"Clear","icon":"clear-night","nearestStormDistance":77,"nearestStormBearing":179,"precipIntensity":0,"precipProbability":0,"temperature":50.48,"apparentTemperature":50.48,"dewPoint":36.5,"humidity":0.59,"windSpeed":5.29,"windBearing":350,"visibility":10,"cloudCover":0,"pressure":1024.19,"ozone":274.03},"minutely":{"summary":"Clear for the hour.","icon":"clear-night","data":[{"time":1449107820,"precipIntensity":0,"precipProbability":0},{"time":1449107880,"precipIntensity":0,"precipProbability":0},{"time":1449107940,"precipIntensity":0,"precipProbability":0},{"time":1449108000,"precipIntensity":0,"precipProbability":0},{"time":1449108060,"precipIntensity":0,"precipProbability":0},{"time":1449108120,"precipIntensity":0,"precipProbability":0},{"time":1449108180,"precipIntensity":0,"precipProbability":0},{"time":1449108240,"precipIntensity":0,"precipProbability":0},{"time":1449108300,"precipIn
View ex.json
{
"results" : [
{
"address_components" : [
{
"long_name" : "1600",
"short_name" : "1600",
"types" : [ "street_number" ]
},
{
@joequery
joequery / sams.sql
Created Nov 30, 2015
Sams Teach Yourself SQL db dump
View sams.sql
CREATE TABLE Customers
(
cust_id char(10) NOT NULL ,
cust_name char(50) NOT NULL ,
cust_address char(50) NULL ,
cust_city char(50) NULL ,
cust_state char(5) NULL ,
cust_zip char(10) NULL ,
cust_country char(50) NULL ,
cust_contact char(50) NULL ,
@joequery
joequery / devvm.conf
Created Nov 12, 2015
VM Port forwarding config
View devvm.conf
#########################
# On host
#########################
server{
auth_basic "Restricted";
auth_basic_user_file /path/to/authfile;
server_name "~^8(?<theport>\d{3})\.vm\.domain\.com$";
location / {
set $baseport "8";
set $fullport $baseport$theport;
@joequery
joequery / session_ex.php
Created Nov 4, 2015
PHP Session Example
View session_ex.php
<?php
session_start();
$num_visits = $_SESSION['page_load_count'];
if(isset($_GET['reset']) || !isset($num_visits)){
$num_visits = 0;
}
$num_visits++;
$_SESSION['page_load_count'] = $num_visits;
@joequery
joequery / cookie_ex.php
Created Nov 4, 2015
PHP Cookie example
View cookie_ex.php
You can’t perform that action at this time.