Skip to content

Instantly share code, notes, and snippets.

@joequery
joequery / sombra_decrypt.php
Last active October 19, 2016 21:54
sombra decryption
<?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 / encrypt.php
Created October 19, 2016 21:12
sombra encrypt
<?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 August 9, 2016 12:29
sombra 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..
*** 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
@joequery
joequery / austin_weather.json
Created December 3, 2015 01:57
Austin weather
{"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
@joequery
joequery / ex.json
Created December 3, 2015 01:29
Example JSON
{
"results" : [
{
"address_components" : [
{
"long_name" : "1600",
"short_name" : "1600",
"types" : [ "street_number" ]
},
{
@joequery
joequery / sams.sql
Created November 30, 2015 17:04
Sams Teach Yourself SQL db dump
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 November 12, 2015 18:28
VM Port forwarding config
#########################
# 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 November 4, 2015 09:07
PHP Session Example
<?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 November 4, 2015 08:22
PHP Cookie example