Skip to content

Instantly share code, notes, and snippets.

Avatar

Roberto Calderon calderonroberto

View GitHub Profile
@calderonroberto
calderonroberto / stsplatform-node-example-callbacks.js
Created Aug 1, 2015
Example using the stsplatform module using callbacks.
View stsplatform-node-example-callbacks.js
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 Mar 8, 2014
Deploy Sinatra application on shared hosting using Passenger (hostmonster)
View dep_sinatra.md

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 Sep 15, 2020
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.
View webservicethreadingtestcase.py
"""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 Aug 1, 2012
jQuery AJAX form submit with Twitter Bootstrap modal
View ajax-form.js
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(),
View tmux.md

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
You can’t perform that action at this time.