This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$address = array( | |
'first_name' => $customer_name, | |
'last_name' => '', | |
'company' => '', | |
'email' => $customer_email, | |
'phone' => $customer_phone, | |
'address_1' => '', | |
'address_2' => '', | |
'city' => '', | |
'state' => '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'fileutils' | |
help = view = gen = apply = edit = del = restore = false | |
letters = '' | |
ARGV.each do |arg| | |
if arg[1] == '-' | |
help ||= arg == '--help' | |
view ||= arg == '--view' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CRITICAL=5 | |
bat_info=`acpi -b` | |
level=`echo $bat_info | grep -o [0-9]*% | sed s/%//` | |
#echo $level | |
if [ ! $level ] | |
then | |
exit | |
fi | |
discharging=`echo $bat_info | grep Discharging` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// allow product links w/o `product/` base for wc | |
// additionaly you can add | |
// RedirectMatch 301 ^/product/(.*)$ /$1 | |
// to `.htaccess` to handle `page?foo=bar` queries | |
// this script is based on this article by Ryan Sechrest: | |
// http://ryansechrest.com/2013/04/remove-post-type-slug-in-custom-post-type-url-and-move-subpages-to-website-root-in-wordpress/ | |
add_action( | |
'pre_get_posts', | |
'custom_pre_get_posts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# support sliding window maximum in linear time | |
srand(123) | |
n = 9 | |
k = 3 | |
m = n-1 | |
a = (0..m).to_a | |
for i in 0..m do | |
#a[i] = (rand()*10).floor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reimplementation of default uncaught exception handler of nodejs v7.2 in js | |
// | |
// produces the same output as default handler of nodejs | |
// handles inline source maps with sinlge source (as V8 does) | |
// does not handle non-inline source maps or maps with multiple sources | |
// | |
// [email protected], public domain | |
"use strict"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Copyright 2006-2015 Mitchell mitchell.att.foicica.com. See LICENSE. | |
-- HAML LPeg lexer. | |
local l = require('lexer') | |
local token, word_match = l.token, l.word_match | |
local P, R, S, V = lpeg.P, lpeg.R, lpeg.S, lpeg.V | |
local M = {_NAME = 'haml'} | |
-- Whitespace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; redirect nav keys to home row | |
; alt+arrows to jikl and some more | |
; !r::Reload | |
; redirect alt+keys saving other mods | |
Redirect(key) { | |
if GetKeyState("Shift", "D") | |
if GetKeyState("Ctrl", "D") | |
Send +^{%key%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##.pagedlist_item:has(a[target="_blank"] > p:has-text(/\sby\s/)) | |
##.pagedlist_item:has(a[target="_blank"] > p:has-text(/\sad\s\sby/)) | |
##.pagedlist_item:has(a[target="_blank"] > p:has-text(/\spromoted\s\sby/)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
f=~/.local/share/recently-used.xbel | |
s=`cat $f` | |
t=`echo "$s" | sed 's/<\/xbel>//g'` | |
target="$@" | |
dt=`date '+%Y-%m-%dT%H:%M:%SZ'` | |
mime=`file -b --mime-type "$target"` |
OlderNewer