Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
#include <IRremote.h> | |
// http://www.pjrc.com/teensy/td_libs_IRremote.html | |
// If one keypress results in multiple codes being output, then | |
// change in IRremoteInt.h: | |
// #define _GAP 50000 | |
int RECV_PIN = 8; | |
IRrecv irrecv(RECV_PIN); | |
decode_results results; |
Введение
Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.
http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html
Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.
Ruby
Patch for ruby 1.9.3-p385 without backport-gc:
Patch for ruby 1.9.3-p385 with backport-gc:
rbenv instructions https://gist.github.com/samgranieri/4772546
# Convert raw stats into hourly stats. | |
def self.squash!(before=Time.now) | |
transaction do | |
range = where(%{ | |
date_trunc('hour', collected_at) < date_trunc('hour', timestamp ?) | |
}, before) | |
from_id, to_id = range.minimum(:id), range.maximum('id') | |
return nil if [from_id, to_id].none? |
Changes:
this version includes backport of Greg Price's patch for speedup startup http://bugs.ruby-lang.org/issues/7158 .
ruby-core prefers his way to do thing, so that I abandon cached-lp and sorted-lf patches of mine.
this version integrates 'array as queue' patch, which improves performance when push/shift pattern is heavily used on Array.
This patch is accepted into trunk for Ruby 2.0 and last possible bug is found by Yui Naruse. It is used in production* for a couple of months without issues even with this bug.
#!/bin/sh | |
ip route |grep default # default via 10.235.9.1 dev eth0 | |
ip route change default via `ip route| awk '/^def/{print $3}'` dev eth0 initcwnd 16 | |
ip route |grep default # default via 10.235.9.1 dev eth0 initcwnd 16 | |
sysctl -w net.ipv4.tcp_slow_start_after_idle=0 | |
sysctl -a |grep net.ipv4.tcp_slow_start_after_idle |
By Ward Bekker
Google's Strange Loop presentation Making the Web Faster inspired me to enable SPDY on one of my side projects Zin In Sushi. This simple sushi restaurant review site is build in Erlang using Basho's Webmachine in combination with Erlydtl.
Below is a quick writeup of the steps needed.
Assumptions: