Skip to content

Instantly share code, notes, and snippets.

@gammy
gammy / gist:1804957
Created February 11, 2012 23:15
pekwm submenu with xrandr two-screen configuration options
Submenu = "Desktop" {
Entry = "Detect & enable screens" { Actions = "Exec xrandr --auto &" }
Entry = "HDMI left of laptop" { Actions = "Exec xrandr --auto --output HDMI1 --right-of LVDS1 --output LVDS1 &" }
Entry = "HDMI right of laptop" { Actions = "Exec xrandr --auto --output HDMI1 --left-of LVDS1 --output LVDS1 &" }
Entry = "HDMI above laptop" { Actions = "Exec xrandr --auto --output HDMI1 --above LVDS1 --output LVDS1 &" }
Entry = "HDMI below laptop" { Actions = "Exec xrandr --auto --output HDMI1 --below LVDS1 --output LVDS1 &" }
Entry = "Disable HDMI" { Actions = "Exec xrandr --output LVDS1 --output HDMI1 --off &" }
Entry = "Disable laptop" { Actions = "Exec xrandr --output HDMI --output LVDS1 --off &" }
}
@jmoiron
jmoiron / bongo.sh
Created June 30, 2012 21:58
export and import all collections from a mongodb database into/outof a single tarball
#!/bin/bash
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] dbname
OPTIONS:
@maartenba
maartenba / cakeunit4phpstorm.php
Last active October 9, 2020 18:16
CakePHP2 PHPUnit Runner for PHPStorm
<?php
// Clean argument values
$phpStormRunner = null;
$cleanedArgv = array();
foreach ($_SERVER['argv'] as $key => $value) {
if (strpos($value, 'ide-phpunit.php') === false) {
$cleanedArgv[] = $value;
} else {
$phpStormRunner = $value;
}
@magnetikonline
magnetikonline / README.md
Last active November 22, 2018 15:05
Subversion (SVN) to Git repository conversion notes.
@elijahmanor
elijahmanor / fake-server-unit-test.js
Last active August 28, 2018 09:23
Unit Test like a Secret Agent with Sinon.js
describe("getTweets - Server", function () {
var server, fakeData = [ /* ... */ ];
before(function () {
// Doesn’t work :( It’s JSONP!
server = sinon.fakeServer.create();
server.respondWith(
"GET",
"https://api.twitter.com/.../elijahmanor.json?count=5",
[200, { "Content-Type": "application/json" }, JSON.stringify(fakeData)]
@smashew
smashew / bongo.sh
Last active October 21, 2024 11:26 — forked from jmoiron/bongo.sh
This one works... Tested
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] dbname
OPTIONS:
-h Show this help.
-l Load instead of export
@SQiShER
SQiShER / metrics.diff
Last active July 13, 2021 19:17
HAProxy Exporter vs. Built-in Metrics
go_gc_duration_seconds | haproxy_backend_active_servers
go_gc_duration_seconds_count | haproxy_backend_backup_servers
go_gc_duration_seconds_sum <
go_goroutines <
go_info <
go_memstats_alloc_bytes <
go_memstats_alloc_bytes_total <
go_memstats_buck_hash_sys_bytes <
go_memstats_frees_total <
go_memstats_gc_cpu_fraction <