Skip to content

Instantly share code, notes, and snippets.

View alzalabany's full-sized avatar
🥕
Building something cool!

Momen Zalabany alzalabany

🥕
Building something cool!
View GitHub Profile
/* generated using http://www.network-science.de/ascii/ */
```js
// _ _ _____ ____ _ _ _____ _______
// _| || |_ / ____|/ __ \ | \ | | / ____||__ __|
// |_ __ _| | | | | | || \| || (___ | |
// _| || |_ | | | | | || . ` | \___ \ | |
// |_ __ _| | |____| |__| || |\ | ____) | | |
// |_||_| \_____|\____/ |_| \_||_____/ |_|
var Promise = require('bluebird'),
mysql = require('mysql'),
using = Promise.using;
Promise.promisifyAll(require("mysql/lib/Connection").prototype);
Promise.promisifyAll(require("mysql/lib/Pool").prototype);
var env = (process.env.NODE_ENV == 'production') ? 'prod': 'dev';
var pools = {};
var base = {
@ranacseruet
ranacseruet / VideoStream.php
Last active April 14, 2024 12:42
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@prime31
prime31 / gist:5675017
Last active April 2, 2024 03:55
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@timonweb
timonweb / gist:3165322
Created July 23, 2012 18:38
Code to catch all PHP errors which result in 500 Error Code. Include this snippet at the beginning of index.php file
<?php
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR |
E_COMPILE_ERROR | E_RECOVERABLE_ERROR);
define('ENV', 'dev');
//Custom error handling vars
define('DISPLAY_ERRORS', TRUE);
define('ERROR_REPORTING', E_ALL | E_STRICT);