start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
#!/bin/sh | |
# Get MacOSX idletime. Shamelessly stolen from http://bit.ly/yVhc5H | |
/usr/sbin/ioreg -c IOHIDSystem | /usr/bin/awk '/HIDIdleTime/ {print int($NF/1000000000); exit}' |
@midnight "sh /home/user/mysqldiff-backup.sh" |
# gem install crack rest-client fastercsv | |
require 'rubygems' | |
require 'crack' | |
require 'rest_client' | |
require 'fastercsv' | |
# To use, get an access token here, by clicking "get access token" | |
# and checking user.groups in the dialog box | |
# https://developers.facebook.com/tools/explorer?method=GET&path=209024949216061%2Ffeed | |
# |
Google Apps Script for Gmail to automatically forward Google Now notes to self onto Remember The Milk, transforming the transcribed speech into Smart Add syntax, and then archiving the thread in Gmail. Create a new script in Google Drive for Gmail, paste this JS into it, customize the rtm_email
variable to your own, and customize the transformations to rtm_task
for Smart Add to fit your style, and then set up a trigger to invoke the function every minute. Within approximately a minute after sending yourself a note via Google Now, the reminder will be added to your RTM account!
Example dictation: Note to self to look up article about widgets for work priority 1
Smart Add transformation: Look up article about widgets #work !1
-- This script includes examples for using AppleScript to perform several | |
-- useful tasks with Evernote. | |
-- Each section illustrates a chunk of Evernote's AppleScript interface, | |
-- and each section also cleans up after itself. | |
-- Please refer to the Evernote application's scripting dictionary for |
<?php | |
/** | |
* Programmatically alter the WooCommerce cart discount total (and apply a new discount) before it's calculated | |
* through the woocommerce_calculate_totals hook. | |
* | |
* For example, if you want to apply an arbitrary discount after a certain number of products in the cart, | |
* you can loop through that number and increment it as needed. | |
* | |
* In this example, I increment the discount by $8.85 after every 15 products added to the cart. | |
* |