Skip to content

Instantly share code, notes, and snippets.

Avatar

Antony D'Andrea antonydandrea

View GitHub Profile
@antonydandrea
antonydandrea / issTracker.js
Created Mar 9, 2017
Amazon Echo I.S.S. Tracker Skill
View issTracker.js
'use strict';
var http = require('http');
const Alexa = require('alexa-sdk');
var alexa;
const handlers = {
'LaunchRequest': function () {
this.emit('GetLocation');
},
@antonydandrea
antonydandrea / mcrypt-test.php
Last active Oct 11, 2016
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
View mcrypt-test.php
<?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])) {