Skip to content

Instantly share code, notes, and snippets.

View beatak's full-sized avatar
🍄
Mushroom

Takashi M beatak

🍄
Mushroom
  • San Francisco, CA
View GitHub Profile
#! /usr/bin/env python
import time
import subprocess
import shutil
import os
from logger import Logger
from config import Config
l = Logger(Config)
@beatak
beatak / last_index.js
Created June 3, 2013 19:59
I should keep the record of these utility functions that I implement many many times…
var lastIndexOf = function (hay, needle) {
var i = hay.split('').reverse().join('').indexOf( needle.split('').reverse().join('') );
var result = -1;
if (i > -1) {
result = hay.length - (i + needle.length);
}
return result;
};
// Warning Duplicate IDs
$('[id]').each(function(){
var ids = $('[id="'+this.id+'"]');
if(ids.length>1 && ids[0]==this)
console.warn('Multiple IDs #'+this.id);
});
@beatak
beatak / query_string_parser.js
Created May 31, 2013 19:08
Works in progress and will make a github repo for this for realz. currently I copied from http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values things i wanted it be able to parse are: - array -- ?a[]=1&a[]=2 // => { a: [1, 2]} -- ?a[0]=1&a[1]=2 // => { a: [1, 2] } **maybe?** - different separator. i think ; (semi-colon) is…
var parseQueryString = ( function () {
"use strict";
return function (query) {
var match,
urlParams = {},
pl = /\+/g,
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); };
query = query || window.location.search;
----------- Payload: Adobe Photoshop CS6 Core_13.1.2_AdobePhotoshop13-Core 13.1.2.0 {xxxxxxxxx} -----------
ERROR: DS015: Unable to read symlink target of source file "/Applications/Adobe Photoshop CS6/Adobe Photoshop CS6.app/Contents/Required/Plug-Ins/Extensions/FastCore.plugin/Contents/CodeResources"(Seq 2)
Please search the above error string(s) to find when the error occurred.
These errors resulted in installer Exit Code mentioned below.
-------------------------------------------------------------------------------------
Exit Code: 7 - Unable to complete Silent workflow.
Please see specific errors for troubleshooting. For example, ERROR: DS015, DW023 ...
*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
function camelcase (str) {
var arr;
if (str.length === 0) {
return;
}
arr = str.split('-');
if (arr.length === 1) {
arr = str.split(' ');
}
if (arr.length === 1) {
@beatak
beatak / ack-filename.sh
Created February 7, 2013 20:15
To get a list of filenames by the result of ack. eg: ack 'foo.+bar' -u ./app | ack-filename.sh
#!/bin/sh
cut -d ':' -f1 < /dev/stdin | sort -u
@beatak
beatak / git-recent.sh
Created February 5, 2013 08:04
via http://d.hatena.ne.jp/kazuhooku/20130205/1360039870 put this file (without suffix) in /usr/local/bin and chmod a+x. in git repository, type `git recent`
#!/bin/sh
(for i in `git branch | colrm 1 2` ; do echo `git log --date=iso8601 -n 1 --pretty="format:[%ai] %h" $i` $i ; done) | sort -r
@beatak
beatak / desktop.el
Created January 31, 2013 01:46
I can't believe why I didn't set this earlier!
;; Desktop
;; naming is weird, but this is basically
;; saving the status of opened files
;;
(setq desktop-files-not-to-save "\\(^/[^/:]*:\\)")
(autoload 'desktop-save "desktop" nil t)
(autoload 'desktop-clear "desktop" nil t)
(autoload 'desktop-load-default "desktop" nil t)
(autoload 'desktop-remove "desktop" nil t)
@beatak
beatak / emacs.sh
Created January 28, 2013 02:34
started to use emacsclient…
#!/bin/sh
echo 'checking process'
PC=`pgrep Emacs`
if [ -z $PC ]
then
echo 'opening daemon'
Emacs --daemon
emacsclient -c &
else