Skip to content

Instantly share code, notes, and snippets.

@cviebrock
cviebrock / wez.itermcolors
Last active September 6, 2015 22:20 — forked from wez/wez.itermcolors
Wez's iTerm 2 Colour selection
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
--- main.py.ORIG 2011-03-22 10:39:57.000000000 -0400
+++ main.py 2011-03-22 10:40:03.000000000 -0400
@@ -71,7 +71,11 @@
raise ValueError("Config value for move_files_destination cannot be None if move_files_enabled is True")
try:
- return cnamer.newPath(destDir, getPathPreview = getPathPreview)
+ if Config['copy_instead_of_move']:
+ return cnamer.newPath(destDir, getPathPreview = getPathPreview, False, True )
+ else:
@cviebrock
cviebrock / string.reverse-and-translate.js
Created June 30, 2011 03:21
String.reverse and String.translate
String.prototype.reverse = function() {
var str='';
for (i=this.length-1;i>=0;i--) {
str += this.charAt(i);
}
return str;
}
String.prototype.translate = function(from,to) {
var sl = this.length,
ScrabbleClub cmv$ git commit -a
# On branch master
# Your branch is ahead of 'origin/master' by 69 commits.
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# (commit or discard the untracked or modified content in submodules)
#
# modified: bundles/eloquent (modified content, untracked content)
@cviebrock
cviebrock / gist:1996271
Created March 7, 2012 21:09
pretend data
/* the users */
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(128) NOT NULL,
`email` varchar(128) NOT NULL,
`password` varchar(128) NOT NULL
);
@cviebrock
cviebrock / gist:1996758
Created March 7, 2012 22:31
serializable abstract eloquent class :)
<?php
class Data extends Aware {
public static $timestamps = true;
public static $table = 'data';
private static $class = null;
<?php
// $rules = array(
// 'field' => 'required|date:Y-m-d'
// );
public function validate_date($attribute, $value, $parameters)
{
$format = $parameters[0];
@cviebrock
cviebrock / gist:2007340
Created March 9, 2012 16:21
Data Factory
<?php
class Data {
public static function factory()
{
$args = func_get_args();
if (count($args)==0) {
@cviebrock
cviebrock / gist:2029682
Created March 13, 2012 16:16
Laravel database init task?
<?php
/**
* /application/tasks/db.php
*/
class DB_Task {
/**
* php artisan db:init [connection] [user]
@cviebrock
cviebrock / github_issues_to_csv_v3.rb
Created October 12, 2012 17:19
Export Github Issues to CSV (OSX 10.7.5 version)
require 'rubygems'
require 'octokit'
require 'fastercsv'
require 'date'
# Description:
# Exports Github issues from one or more repos into CSV file formatted for import into JIRA
# Note: By default, all Github comments will be assigned to the JIRA admin, appended with
# a note indicating the Github user who added the comment (since you may not have JIRA users
# created for all your Github users, especially if it is a public/open-source project: