Skip to content

Instantly share code, notes, and snippets.

View lingo's full-sized avatar

Luke Hudson lingo

View GitHub Profile
# Based on code here: http://westhoffswelt.de/blog/0036_xpath_to_select_html_by_class.html
$x('//a[@class
and (
contains(normalize-space(@class), " q ")
or starts-with(normalize-space(@class), "q ")
or substring(normalize-space(@class), string-length(normalize-space(@class)) - string-length("q")) = " q"
or @class = "q"
)
Property changes on: sapphire/core/model
___________________________________________________________________
Added: svn:ignore
+ .SiteTree.php.swp
Index: sapphire/forms/ComplexTableField.php
===================================================================
--- sapphire/forms/ComplexTableField.php (revision 109060)
+++ sapphire/forms/ComplexTableField.php (working copy)
<?php
/**
* Load a YAML fixture file into the Database.
* Good for quick dump/restore for testing, or for scaffolding a database.
*/
class PermanentFixtureTask extends BuildTask {
public function run($request) {
$yaml = new YamlFixture($request->requestVar('file'));
@lingo
lingo / glslang
Created August 7, 2012 16:37
glsl fiddling
// From iq's latest live coding video, "a simple eye ball"
#ifdef GL_ES
precision highp float;
#endif
uniform vec2 resolution;
uniform vec2 mouse;
uniform float time;
# Command line volume control #
In order to control the master volume in linux via the command line, you can use amixer (assuming this is available in your distribution).
## Example: ##
Increase master volume by 5 units
amixer set Master "5+"
@lingo
lingo / LinuxDotfiles
Last active August 29, 2015 14:00
List of linux dotfiles and the packages that install/manage them
# Please fork/edit and add to this list #
I'm trying to maintain a database of linux dotfiles created in the home directory, and which packages create/use these files.
Many of these are self-explanatory (i.e. named after package), but I'll list all I can for potential programmatic use.
Here are some I know about (more to come):
## Format: dotfile <tab> package[,package,...] <tab> description
```
.bash_history bash
@lingo
lingo / kernel_upg.sh
Created May 22, 2014 18:28
Kernel upgrade script for *buntu
#!/bin/sh
echo "$(tput setaf 3)--- Kernel 3.13 will be installed in an `uname -i` system---$(tput sgr0)"
echo ""
sleep 2
read -p "Press Enter to continue, or abort by pressing CTRL+C" nothing
@lingo
lingo / vagrant_suspend_all
Created June 12, 2014 01:32
Suspend all running vagrant machines
#!/usr/bin/python
"""
Suspend all running vagrant machines, based on what is found in
user's ~/.vagrant.d files
Usage:
vagrant_suspend_all
"""
from json import load as loadJSON
import sys
@lingo
lingo / gist:5e53d2cb5b282d53d912
Last active May 9, 2022 21:19
Separation of logic from request handlers
// mylogic.js
var MyLogic = {
_currentAccount: null,
fetchAccountByID: function(id) {
// fetch account from database, use promises to reject/resolve
},
setCurrentAccount: function(account) {
MyLogic._currentAccount = account;
}
@lingo
lingo / test.log
Created August 5, 2014 18:34
superagent@0.18.2 npm test
> superagent@0.18.2 test /tmp/superagent
> make test
․․․․․․․․․․․․․․․double callback!
․double callback!
․double callback!
․double callback!
․double callback!