This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require(process.cwd() + '/app'); | |
var winston = require('winston'); | |
var _ = require('lodash'); | |
// Set up logger | |
var customColors = { | |
trace: 'white', | |
debug: 'green', | |
info: 'green', | |
warn: 'yellow', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Spinner | |
{ | |
# Detects whether to use the nested or flat version of the spinner (costs some speed) | |
public static function detect($text, $seedPageName = true, $openingConstruct = '{{', $closingConstruct = '}}', $separator = '|') | |
{ | |
if(preg_match('~'.$openingConstruct.'(?:(?!'.$closingConstruct.').)*'.$openingConstruct.'~s', $text)) | |
{ | |
return self::nested($text, $seedPageName, $openingConstruct, $closingConstruct, $separator); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$extensions = get_loaded_extensions(); | |
if( is_array($extensions) && sizeof($extensions) ) { | |
natcasesort($extensions); | |
foreach($extensions as $ext) { | |
echo "$ext <br />"; | |
} | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev | |
git clone https://github.com/joyent/node.git | |
cd node | |
# 'git tag' shows all available versions: select the latest stable. | |
git checkout enter-a-version | |
# Configure seems not to find libssl by default so we give it an explicit pointer. | |
# Optionally: you can isolate node by adding --prefix=/opt/node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'), | |
path = require('path'), | |
fs = require('fs'), | |
util = require('util'); | |
http.createServer(_handler).listen(3000); | |
console.log('Server running at http://127.0.0.1:3000/'); | |
function _handler(req, res) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript"></script> | |
<script src="https://raw.github.com/carlo/jquery-base64/master/jquery.base64.min.js" type="text/javascript"></script> | |
<script src="http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/hmac-sha1.js"></script> | |
<script type="text/javascript"> | |
var secondsInDay = 86400; | |
// Credentials | |
var apiKey = '<apiKey>'; | |
var secret = '<secret>'; | |
var sessionId = '1_MX4xMTMzMTg5Mn4xMjcuMC4wLjF-U3VuIERlYyAwMiAwNjo0NTozMSBQU1QgMjAxMn4wLjQwMjY2OH4'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("deviceready", deviceisready, false); | |
function deviceisready(){ | |
alert("Device Ready is called"); | |
document.addEventListener("backbutton", function(e){ | |
if ( $('.ui-page-active').attr('id') == 'mainpage') { | |
//window.location = "#exitDialog"; | |
exitAppPopup(); | |
}else{ | |
history.back(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Storage.prototype.setArray = function(key, obj) { | |
return this.setItem(key, JSON.stringify(obj)) | |
} | |
Storage.prototype.getArray = function(key) { | |
return JSON.parse(this.getItem(key)) | |
} | |
var gatheredPosts = new Array(); | |
// let's imagine these "posts" come from a remote data call which has just returned |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Macro | |
HTML::macro('table', function($fields = array(), $data = array(), $resource, $showEdit = true, $showDelete = true, $showView = true){ | |
$table = '<table class="table table-bordered">'; | |
$table .='<tr>'; | |
if ($showEdit || $showDelete || $showView ) | |
$table .= '<th></th>'; | |
foreach ($fields as $field) | |
{ | |
$table .= '<th>' . Str::title($field) . '</th>'; |