Skip to content

Instantly share code, notes, and snippets.

View antonydandrea's full-sized avatar

Antony D'Andrea antonydandrea

View GitHub Profile
@antonydandrea
antonydandrea / mcrypt-test.php
Last active October 11, 2016 07:13
A simple mcrypt example being set and retrieved in a cookie. For some reasion, in PHP 7, setcookie doesn't appear to set anything and $_COOKIE returns null
<?php
$cookie_name = 'my_cookie';
$key = 'L+Hu+ ~bK$BUd;Jcc;M+/d7LP#qzU_i6P&Aq86Q/}=wYuUo:Q}@Y)(=d|y}+E5.oK)hgHH1R|/)v-zR-cp}E3|FdnY/&jd^&o/mKO&|Vhn2liz#PY~|^}6Zc:u? O^|p';
$secure = '0';
$session_id = 'ABCDEFGHIJKLMNOP';
$data = $session_id.'~~'.$secure;
$mode = MCRYPT_MODE_NOFB;
$cipher = MCRYPT_RIJNDAEL_128;
$key_size = mcrypt_get_key_size($cipher, $mode);
if (isset($key[$key_size])) {
@antonydandrea
antonydandrea / issTracker.js
Created March 9, 2017 19:58
Amazon Echo I.S.S. Tracker Skill
'use strict';
var http = require('http');
const Alexa = require('alexa-sdk');
var alexa;
const handlers = {
'LaunchRequest': function () {
this.emit('GetLocation');
},