#!/bin/bash | |
COMMIT=$1 | |
BRANCH=$2 | |
if [ -z $BRANCH ]; then | |
BRANCH="master" | |
fi | |
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /10$/' \ | |
<(git rev-list --ancestry-path --oneline $COMMIT..$BRANCH) \ |
from fabric.api import * | |
""" | |
Base configuration | |
""" | |
env.project_name = '$(project)' | |
env.database_password = '$(db_password)' | |
env.site_media_prefix = "site_media" | |
env.admin_media_prefix = "admin_media" | |
env.newsapps_media_prefix = "na_media" |
#!/usr/bin/env python | |
# | |
# PoC: Manage a git repository in ~/.task that gets updated on changes. | |
# Only pending.data and completed.data are included by default. | |
# You can use "git add" to add whatever files you want to track in your | |
# task folder. | |
# | |
# Inspired by https://gist.github.com/Unode/9366218 | |
# | |
# Works with any Taskwarrior version that supports hooks. |
//+------------------------------------------------------------------+ | |
//| 1_Min_Micro_Trading.mq4 | | |
//| StarLimit Software Corps., | | |
//| starlimit04@yahoo.com | | |
//+------------------------------------------------------------------+ | |
#property copyright "StarLimit Software Corps.," | |
#property link "starlimit04@yahoo.com" | |
#property indicator_chart_window |
var user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |
Until last night I lived in fear of tildes, carats, resets and reverts in Git. I cargo culted, I destroyed, I laid waste the tidy indicies, branches and trees Git so diligently tried to maintain. Then Zach Holman gave a talk at Paperless Post. It was about Git secrets. He didn't directly cover these topics but he gave an example that made me realize it was time to learn.
Generally, when I push out bad code, I panic, hit git reset --hard HEAD^
, push and clean up the pieces later. I don't even really know what most of that means. Notational Velocity seems to be fond of it ... in that I just keep copying it from Notational Velocity and pasting it. Turns out, this is dumb. I've irreversibly lost the faulty changes I made. I'll probably even make the same mistakes again. It's like torching your house to get rid of some mice.
Enter Holman. He suggests a better default undo. git reset --soft HEAD^
. Says it stag
#!/bin/bash | |
# License: Public Domain. | |
# Author: Joseph Wecker, 2012 | |
# | |
# -- DEPRICATED -- | |
# This gist is slow and is missing .bashrc_once | |
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch | |
# (Thanks gioele) | |
# | |
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile? |
/*! | |
* jQuery TextChange Plugin | |
* http://www.zurb.com/playground/jquery-text-change-custom-event | |
* | |
* Copyright 2010, ZURB | |
* Released under the MIT License | |
*/ | |
(function ($) { | |
$.event.special.textchange = { |
#!/bin/bash | |
# Monitors for signals from gnome-screensaver and activates or deactivates | |
# bitcoin miners accordingly. | |
# Params to the mining programs are all hardcoded. Change 'em manually. Leave the "&"s. | |
dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'" | \ | |
while read line; do | |
case "$line" in |