I hereby claim:
- I am erikaheidi on github.
- I am erikaheidi (https://keybase.io/erikaheidi) on keybase.
- I have a public key whose fingerprint is FA32 E8B9 E641 510B BA22 F1B3 1E72 5495 DACB 5582
To claim this, I am signing this object:
/* | |
* DEMO IRremote Receive using the retired generic keychan remote control form Sparkfun | |
* https://www.sparkfun.com/products/retired/10280 | |
* | |
* IR Receiver on PIN 2 | |
* @author Erika Heidi | |
*/ | |
#include <IRremote.h> |
/* | |
POMODORO 0.2 | |
by @erikaheidi | |
January 2015 | |
LED STATES: | |
starts blue - idle. When the button is clicked, it starts a pomodoro working phase. LED will be a red "breathing" style. | |
After the time is done, it will change to GREEN (static) - indicating that the pomodoro was completed and now you should go to a PAUSE | |
When clicking the button, the PAUSE phase will start (GREEN "BREATHING"). It will turn to RED (static) when the pause is done, indicating that | |
a new WORKING phase should follow. When the button is clicked, starts over with the WORKING phase (RED breathing LED) :) |
I hereby claim:
To claim this, I am signing this object:
September 14, 2015 Meeting
##About Networks, connections and relationships
##PHPWomen
##Learning PHP
function parse_signed_request($signed_request, $secret) { | |
list($encoded_sig, $payload) = explode('.', $signed_request, 2); | |
// decode the data | |
$sig = base64_url_decode($encoded_sig); | |
$data = json_decode(base64_url_decode($payload), true); | |
if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') { | |
error_log('Unknown algorithm. Expected HMAC-SHA256'); | |
return null; |
<?php | |
/* on config.php you put your initialization stuff, like session start and bd connection */ | |
require_once("includes/config.php"); | |
$uri = $_SERVER['REQUEST_URI']; | |
/* default is index */ | |
$pagina = "index"; | |
if($uri != "/") | |
{ |
{ | |
"require" : { | |
"silex/silex": "1.0.*@dev", | |
"twig/twig": ">=1.8,<2.0-dev", | |
"symfony/twig-bridge": "~2.1", | |
"symfony/config": "~2.1", | |
"symfony/yaml": "~2.1", | |
"symfony/translation": "~2.1" | |
} | |
} |
<?php | |
$app->register(new Silex\Provider\TranslationServiceProvider(), array( | |
'locale_fallback' => 'en', | |
)); | |
$app['translator'] = $app->share($app->extend('translator', function($translator, $app) { | |
$translator->addLoader('yaml', new YamlFileLoader()); | |
return $translator; |
<?php | |
$lang = "en"; | |
if ($app['session']->get('current_language')) { | |
$lang = $app['session']->get('current_language'); | |
} | |
foreach (glob(__DIR__ . '/locale/'. $lang . '/*.yml') as $locale) { | |
$app['translator']->addResource('yaml', $locale, $lang); | |
} |
<?php | |
$app->get('/lang/{lang}', function($lang) use($app) { | |
/* | |
* check if language exists | |
*/ | |
if (is_dir(__DIR__ . '/locale/' . $lang)) { | |
/* save user selection in session */ | |
$app['session']->set('current_language', $lang); | |
} |