- Download the perforce visual tool suite from here: http://www.perforce.com/perforce/downloads/index.html
- Copy only the p4merge.app file into your /Applications/ directory
on run {input, parameters} | |
set todoList to {} | |
repeat with theMessage in input | |
-- Grab message info. | |
tell application "Mail" | |
-- Remove apostrophes from Subject as they wreak havoc. | |
set AppleScript's text item delimiters to {"'"} |
function Foo(who) { | |
this.me = who; | |
} | |
Foo.prototype.identify = function() { | |
return "I am " + this.me; | |
}; | |
function Bar(who) { | |
Foo.call(this,"Bar:" + who); |
$(function() { | |
// good opportunity to combine into a single statement | |
// qq w cw <esc> A, <esc> 0 j q | |
var a = 10; | |
var b = 20; | |
var c = 30; | |
var d = 40; | |
var e = 50; | |
// opportunity to simplify syntax |
#!/bin/bash | |
############################ | |
#script function | |
############################ | |
setProperty(){ | |
awk -v pat="^$1=" -v value="$1=$2" '{ if ($0 ~ pat) print value; else print $0; }' $3 > $3.tmp | |
mv $3.tmp $3 | |
} | |
############################ |
I was tired of Chrome eating all my laptop resources so I decided to put some limit to it with cgroup.
As I was using Ubuntu 12.04 with support for cgroup, I installed the package cgroup-bin
and add the following group to the file /etc/cgconfig.conf
:
group browsers {
cpu {
# Set the relative share of CPU resources equal to 25%
cpu.shares = "256";
}
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
on run {input, parameters} | |
-- This code comes from http://raduner.ch/blog/ | |
-- To be used with an Automator Service | |
-- ------------------------------------------------ | |
tell application "System Events" | |
keystroke "c" using {command down} | |
end tell | |
set inputText to the clipboard as Unicode text | |
Upgrading to Lion or Yosemite and WebStorm 9, I noticed key repeat was
turned off for the IdeaVim plugin h j k l keys.
defaults write -g ApplePressAndHoldEnabled -bool false
in a terminal will enable
key repeat for every app. This can alternatively be found in the accessibility
settings in OS X' preferences.