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
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| import argparse | |
| import os | |
| import sys | |
| import time | |
| import atexit | |
| import logging | |
| import signal |
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'; |
Prereq:
apt-get install zsh
apt-get install git-coreGetting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
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 | |
| define('WYSIWYG_META_BOX_ID', 'my-editor'); | |
| define('WYSIWYG_EDITOR_ID', 'myeditor'); //Important for CSS that this is different | |
| define('WYSIWYG_META_KEY', 'extra-content'); | |
| add_action('admin_init', 'wysiwyg_register_meta_box'); | |
| function wysiwyg_register_meta_box(){ | |
| add_meta_box(WYSIWYG_META_BOX_ID, __('WYSIWYG Meta Box', 'wysiwyg'), 'wysiwyg_render_meta_box', 'post'); | |
| } |
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
| #!/bin/bash | |
| # http://www.vladimirm.com/blog/2011/06/export-files-from-mongodb-gridfs-with-directory-paths/ | |
| _host="${1:?Usage: gridfs host db}" | |
| _db="${2:?Usage: gridfs host db}" | |
| while read -r line; do | |
| file=$(echo "$line" | awk -F'\t' '{ print $1 }') | |
| [[ $file == 'connected to'* ]] && continue | |
| directory=${file%/*} | |
| mkdir -p $directory |
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
| // This is the Android version of the Tweetie-like pull to refresh table: | |
| // http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html | |
| var win = Ti.UI.currentWindow; | |
| var alertDialog = Titanium.UI.createAlertDialog({ | |
| title: 'System Message', | |
| buttonNames: ['OK'] | |
| }); | |
| var scrollView = Ti.UI.createScrollView({ |
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 detectBackOrForward = function(onBack, onForward) { | |
| hashHistory = [window.location.hash]; | |
| historyLength = window.history.length; | |
| return function() { | |
| var hash = window.location.hash, length = window.history.length; | |
| if (hashHistory.length && historyLength == length) { | |
| if (hashHistory[hashHistory.length - 2] == hash) { | |
| hashHistory = hashHistory.slice(0, -1); | |
| onBack(); |
NewerOlder