Skip to content

Instantly share code, notes, and snippets.

View printminion's full-sized avatar
💭
Time flies like an arrow; fruit flies like a 🍌

@printminion printminion

💭
Time flies like an arrow; fruit flies like a 🍌
View GitHub Profile
function doGet() {
var app = UiApp.createApplication();
var t = app.createTextBox().setName('t').setId('t');
app.add(t);
app.add(app.createButton('OK', app.createServerHandler('click').addCallbackElement(t)));
return app;
}
function click(e) {
var app = UiApp.getActiveApplication();
if(e.parameter.t == '') return;
function doGet() {
var app = UiApp.createApplication();
var t = app.createTextBox().setName('t').setId('t');
app.add(t);
app.add(app.createButton('OK', app.createServerHandler('click').addCallbackElement(t)));
return app;
}
function click(e) {
var app = UiApp.getActiveApplication();
if(e.parameter.t == '') return;
// 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';
(function (window, checkNode){
var p = {};
var m = {
registerObserver: function() {
if (typeof(window.WebKitMutationObserver) == "undefined") return;
p.observer = new window.WebKitMutationObserver(function(mutationRecords) {
mutationRecords.forEach(function(mutationRecord) {
for (var i = 0; i < mutationRecord.addedNodes.length; ++i)
/*
Chrome Packaged app Bluetooth API test
Before interacting with a BT device, you need to :
1) get the device MAC and service UUID with startDiscovery and getServices methods
2) request permission with chrome.permissions.request
3) add the service profile with chrome.bluetooth.addProfile (a profile is only {uuid:'xxxxxxx...'})
*/
// onConnection callback
chrome.bluetooth.onConnection.addListener(
# install dependencies
sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm
# clone cpuminer
git clone https://github.com/pooler/cpuminer.git
# compile
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3"
// 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';
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
sha256sum -b ./dbapp.war > ./dbapp.sha256
gsutil cp ./dbapp.war ./dbapp.sha256 gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/
gsutil setacl public-read gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/dbapp.war
gsutil setacl public-read gs://stathy/${JOB_NAME}/${BUILD_NUMBER}/dbapp.sha256
cd ${WORKSPACE}
gcutil addinstance dbapp-db dbapp-app1 dbapp-lb \
--project "opscode.com:stathy" --image "/projects/opscode.com:stathy/images/centos-latest" \