Skip to content

Instantly share code, notes, and snippets.

from tornado import gen
import tornado.testing
import motor
class MyTestCase(tornado.testing.AsyncTestCase):
def test_thing(self):
client = motor.MotorClient('localhost', 27017, io_loop=self.io_loop)
client.open_sync()
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
</block>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}
sudo make modules_install
sudo mkinitcpio -k 3.18.0-rc5-ARCH -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-3.18.0-rc5.img
make bzImage
sudo cp arch/x86/boot/bzImage /boot/vmlinuz-linux-3.18.0-rc5
sudo cp System.map /boot/
<?php
/**
* Get the recurring cost of a single server or all servers on your account.
*
* Perform two operations:
* 1) Get a list of servers on a SoftLayer account along with their recurring
* monthly costs. We can get that by calling getHardware() in the
* SoftLayer_Account API service with an object mask to retrieve cost.
* 2) Get the cost for a single server by calling getCost() in the
* SoftLayer_Hardware_Server service.
@scupython
scupython / MyData.hs
Last active August 29, 2015 14:08 — forked from BinRoot/MyData.hs
module MyData
(MetricUnit(..),
ImperialUnit(..),
Measurement(..),
convert)
where
data MetricUnit = Meter
| Liter
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
<tr ng-repeat="ahm in ahms">
<td>
<input type="checkbox" ng-model="ahm.selected">
</td>
<td>
<a href="#/nagios/[[appid]]/ahm/[[ahm.host.pub_ip]]">
[[ahm.host.hostname]]-[[ahm.host.pub_ip]]
</a>
</td>
<td>
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
@scupython
scupython / gist:fbd8c1f411d5f28d1481
Created July 21, 2014 08:17
cp *.cfg.sample to *.cfg
for f in `ls *`; do
cp $f `echo $f|cut -d. -f1`.cfg
done
@scupython
scupython / js.js
Last active August 29, 2015 14:03
ELEXOPS.factory("gservice", function($http, $window){
var gamesPromise;
var httpGet = function(url) {
return $http.get(url).then(
function(resp){
return resp.data;
},
function(error){
$window.alert("Http Get Error: " + error);
});