Skip to content

Instantly share code, notes, and snippets.

View tjnicolaides's full-sized avatar

TJ Nicolaides tjnicolaides

  • Airbnb
  • Philadelphia, PA
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tjnicolaides on github.
  • I am tjnicolaides (https://keybase.io/tjnicolaides) on keybase.
  • I have a public key ASDIbc1yNHr1i8OCfa1U022ZBGhqnE7RsLebRzIiopAuFAo

To claim this, I am signing this object:

@tjnicolaides
tjnicolaides / encrypt-decrypt.php
Created December 17, 2015 16:22
[PHP] - Encrypt/Decrypt a string without a known key
<?PHP
/*
Description : A function with a very simple but powerful xor method to encrypt
and/or decrypt a string with an unknown key. Implicitly the key is
defined by the string itself in a character by character way.
There are 4 items to compose the unknown key for the character
in the algorithm
1.- The ascii code of every character of the string itself
2.- The position in the string of the character to encrypt
3.- The length of the string that include the character
@tjnicolaides
tjnicolaides / group_objects_by_date.php
Created February 3, 2012 04:51
Group array objects by closest start and end dates
<?php
// function described in greater detail here:
// http://stackoverflow.com/questions/8492458/whats-the-best-logic-for-grouping-objects-by-closest-start-and-end-dates
function cmp($a, $b){
return strcmp($a['start'], $b['start']);
}
$query = array(array('name' =>'A','start' =>'1/1/2011','end' =>'1/31/2011'),array('name' =>'B','start' =>'1/15/2011','end' =>'1/31/2011'),array('name' =>'C','start' =>'2/1/2011','end' =>'2/28/2011'),array('name' =>'D','start' =>'2/2/2011','end' =>'2/28/2011'),array('name' =>'E','start' =>'1/31/2011','end' =>'3/1/2011'), array('name' =>'F','start' =>'3/3/2011','end' =>'3/31/2011'));
@tjnicolaides
tjnicolaides / slideshow-api-example.js
Created February 3, 2012 04:47
E_Interactive Custom AJAX Slideshow
// XML from Basestation Slideshow API -- AJAX
// - requires jQuery
$(document).ready(function() {
var slide = [];
var rotator = "872";
$.ajax({
type:'GET',
url:'http://www.ei_domain.com/_SHARED/ApplicationData/Public/FlashWriter.aspx?RotatorGroupID='
@tjnicolaides
tjnicolaides / blog-api-example.js
Created February 3, 2012 04:43
E_Interactive Blog Tool SOAP XML Request
// XML from Basestation Blog SOAP API -- AJAX
// - requires jQuery
$(document).ready(function() {
blogID = "1001334";
entriesRequested = "25";
payload = '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
' xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> ' +
' <soap:Body> ' +
' <GetXMLBlogsContent xmlns="http://www.emmisinteractive.com/"> ' +