(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.
(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.
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.
In most cases, the sudo
command displays the error unable to initialize PAM: No such file or directory
mostly appears when the pluggable authentication module file /etc/pam.d/sudo
has been edited with a typo or an incorrect PAM module.
If you have an older Mac, you can boot into single-user mode
, which allows you to access the command line mode of macOS directly, bypassing the UI.
Press and hold down the COMMAND + S
keys until you see commands being executed in the Terminal.
Open the sudo
file with vi /Volumes/Macintosh\ - Data/etc/pam.d/
, fix what's wrong, save and close the file by switching from INSERT
to the COMMAND
mode with the ESC
key, type :wq!
, and hit enter
.
From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:
There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.
That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.
function Foo(who) { | |
this.me = who; | |
} | |
Foo.prototype.identify = function() { | |
return "I am " + this.me; | |
}; | |
function Bar(who) { | |
Foo.call(this,"Bar:" + who); |
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";
}
// | |
// This program reads a sourcemap from stdin | |
// and replaces the "mappings" property with | |
// human readable content. It writes the output | |
// to stdout. | |
// | |
// 1. install the dependencies: | |
// npm i concat-stream vlq | |
// | |
// 2. optional: install jq for pretty printing json |
class Mapping { | |
constructor (public from: ObjectConstructor) { | |
this.to = from | |
} | |
to: ObjectConstructor | |
scope = 'singleton' | |
onActivation: (resolved, ...args) => {} | |
} | |
export class Kernel { |
#!/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 | |
} | |
############################ |