Skip to content

Instantly share code, notes, and snippets.

@MichaelMackus
MichaelMackus / phinditforme.php
Created April 30, 2011 19:24 — forked from mheadd/phinditforme.php
A Tropo script to find locations in Philadelphia.
<?php
/**
* PhindItForMe - an IM, SMS, Twitter and Phone application that finds locations in Philadelphia.
*
* @copyright 2011 Mark J. Headd (http://www.voiceingov.org)
* @author Mark Headd
*/
// Constants used to geocode an address.
#!/bin/sh
#
# description: This script runs a node.js instance for a specific user & application.
# The idea is to allow multiple userland node.js instances.
#
# Run with /etc/init.d/node start USERNAME [USERHOME]
# Above will launch the node.js instance in HOME/app/app.js
#
function evenRowHeights() {
// count the rows
// requires each column to have the same number of rows as column 1
var rowCount = $('.stat-table .c1 > div').length;
$('.stat-table .c1 > div').height('auto');
for (i=0; i<rowCount; i++) {
rowNum = i+1
var tallest = 0;
$('.stat-table .r' + rowNum).each(function() {
if($(this).height() > tallest) {
@MichaelMackus
MichaelMackus / IncludeRawExtension.php
Created July 22, 2015 00:34
Include raw twig template
<?php
class IncludeRawExtension extends \Twig_Extension
{
public function getFunctions()
{
return [
new \Twig_SimpleFunction(
'includeRaw',
[$this, 'includeRaw'],
import XMonad
import XMonad.Config.Azerty
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig
import Graphics.X11.ExtraTypes.XF86
import XMonad.Layout.Spacing
import XMonad.Layout.NoBorders(smartBorders)
import XMonad.Layout.PerWorkspace
@MichaelMackus
MichaelMackus / ardour
Created May 20, 2020 19:08
Ardour helper script to check the audio interface is setup properly
#!/bin/sh
DEVICE="UMC1820"
CARD="$(aplay -l | grep "$DEVICE" | sed 's/^card \([0-9]*\).*/\1/')"
TERMINAL="st"
# find the following settings with amixer -c $CARD
CLOCK_SOURCE_SETTING="UMC1820 Clock Selector Clock Source"
CLOCK_SOURCE_VALUE="Item0: 'Coaxial In SPDIF'" # ensure this value is set for clock source
CLOCK_VALIDITY_SETTING="Coaxial In SPDIF Validity"
#!/bin/sh
# This tool launches battle.net, waits for it to be ready, then launches your
# game via the launcher for easy steam integration.
#
# Inspired from bnetlauncher, which only works on Windows due to a dependency on WMI:
# https://github.com/dafzor/bnetlauncher
#
# To use, please set the variables in the "Configuration" section - mainly, you
# need to set LUTRIS_BNET_IDENTIFIER to the "Identifier" for the Battle.net
@MichaelMackus
MichaelMackus / traderie-relist.py
Last active October 27, 2023 19:50
Relist all items on traderie
# Relist on traderie. You need to login via Chrome browser. Outputs next relist time in command line.
#
# Requires selenium, seleniumbase, and chromedriver
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import InvalidCookieDomainException
from seleniumbase import SB
from os.path import expanduser