As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/bin/bash | |
| # This script subscribes to a MQTT topic using mosquitto_sub. | |
| # On each message received, you can execute whatever you want. | |
| while true # Keep an infinite loop to reconnect when connection lost/broker unavailable | |
| do | |
| mosquitto_sub -h "127.0.0.1" -t "test" | while read -r payload | |
| do | |
| # Here is the callback to execute whenever you receive a message: |
| #!/bin/bash | |
| mongod=/usr/local/mongodb/bin/mongod | |
| mongod_data=/Users/michito/work/mongodb_data | |
| mongod_log=/Users/michito/work/mongodb_log/mongodb.log | |
| prog=mongod.sh | |
| RETVAL=0 | |
| stop() { | |
| grep_mongo=`ps aux | grep -v grep | grep "${mongod}"` |
| #!/usr/bin/env bash | |
| # bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2013-07-11 | |
| # | |
| # _______________| netspeed : check download speed via command line. | |
| # | |
| # Usage: netspeed [tokyo, london, usw, use, east, west, URL] | |
| # ^default U.S. west coast. | |
| # [ -speed_KB/sec ] | |
| # ^negation activates the Mbps converter. | |
| # |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| /* Start by creating a reader for some fake yet conceivable type for executing SQL queries. */ | |
| val dbReader: Reader[Properties, JdbcExecutor] = | |
| for { | |
| driver <- read[String]("db.driver") | |
| uri <- read[String]("db.uri") | |
| user <- read[String]("db.username") | |
| password <- read[String]("db.password") | |
| name <- read[String]("db.pool.name") | |
| minCons <- read[Int]("db.pool.minConnections") |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.host; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" |
| #!/usr/bin/env python | |
| if True: | |
| myval = "True" | |
| else: | |
| myval = "False" | |
| # The Control statements appear to NOT have any strict scope. | |
| print myval # This will infact print "True" o_O |
| #!/usr/bin/env python | |
| from twilio.rest import TwilioRestClient | |
| account = "xxxxxxxxxxxxxxxx" | |
| token = "xxxxxxxxxxxxxxxxxx" | |
| client = TwilioRestClient(account, token) | |
| pull_num = "+18015555556" | |
| victim = "+18015555555" |
| import com.mongodb.casbah.Imports._ | |
| class CasbahPlay { | |
| private val mongoConn = MongoConnection() | |
| private val coll = mongoConn("mongotalk")("unicorns") | |
| def getWeight(name: String) = { | |
| val unicorn = (coll.findOne(MongoDBObject("name" -> name)).get | |
| // This is returning Option[Int] = Some(450.0) |