Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View calderonroberto's full-sized avatar

Roberto Calderon calderonroberto

View GitHub Profile
@calderonroberto
calderonroberto / stsplatform-node-example-callbacks.js
Created August 1, 2015 00:08
Example using the stsplatform module using callbacks.
sts = require('../stsplatform');
// Create a Client.
var client = new sts.Client();
// Create a sensor object, referencing the client/
var sensor = new sts.Sensors(client, 'calderonroberto.demo');
// Get the sensor information (print the response code)
sensor.get(null, function(error,response){
@overdawn
overdawn / dep_sinatra.md
Created March 8, 2014 12:34
Deploy Sinatra application on shared hosting using Passenger (hostmonster)

Deploy Sinatra application on shared hosting using Passenger (hostmonster)

Prepare the application

  • Create folder ~/yourapp
  • Create folder ~/yourapp/tmp
  • Create file ~/yourapp/config.ru with the following content:
# encoding: UTF-8
require './appmain'
@prschmid
prschmid / webservicethreadingtestcase.py
Last active March 31, 2022 13:21
An example of how to perform a multi-threaded unit test of a web service. The particulars of this example make use of some conventions used when developing a web service when using the Flask microframework, but can be modified to fit most needs.
"""An example of how to perform a multi-threaded unit test of a web service.
The particulars of this example make use of some conventions used when
developing a web service when using the Flask microframework, but can be
modified to fit most needs.
"""
import json
import threading
import time
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a