Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
/* definition of thread argument passed to pool wrapper*/ | |
typedef struct { | |
thread_pool *pool; | |
uint64_t id; | |
} thread_argument; | |
////////////////////////////////////////////////////////////// | |
// thread_pool_wrapper: thread start routine waiting for tasks | |
// to execute | |
///////////////////////////////////////////////////////////// |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
perl -e '@r = ("A".."Z", 0..9); foreach (1..shift) { print join "", @r[ map { rand @r } 1..16 ], "\n" }' -- 8 | |
# perl -e 'print join "", ("A".."Z")[ map { rand @("A".."Z") } 1..shift ], "\n"' -- 16 |
# `sudo' is needed on Debian | |
lsof -n -i4TCP:7777 |
On naming and cache
There are only two hard things in Computer Science: cache invalidation and naming things.
-- Phil Karlton
On reusing code
There are two "rules of three" in [software] reuse:
a. It is three times as difficult to build reusable components as single use components, and
b. a reusable component should be tried out in three different applications before it will be sufficiently general to accept into a reuse library.
#!/usr/bin/expect -f | |
set timeout 10; # set timeout to -1 to wait forever | |
set hda "obj/kern/kernel.img" | |
# spawn qemu -nographic -hda $hda -serial "file:jos.out" -monitor null -no-reboot | |
spawn qemu -nographic -hda $hda -monitor null -no-reboot | |
# interact | |
expect { |
<!-- Get NumLock on keypad to work on osx for G80-3494, Realforce and so on --> | |
<!-- By https://groups.google.com/d/msg/osx-karabiner/-2ns5XVXXdQ/kDGIKVSztjwJ --> | |
<item> | |
<name>Map NumLock to OSX NumLock function</name> | |
<identifier>private.pc_numlock_to_mac_numlock</identifier> | |
<autogen>__KeyToKey__ KeyCode::KEYPAD_CLEAR, KeyCode::VK_IOHIKEYBOARD_TOGGLE_NUMLOCK</autogen> | |
</item> |
/* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
*/ | |
#include <arpa/inet.h> | |
#include <linux/if_packet.h> | |
#include <stdio.h> |
package main | |
import ( | |
"errors" | |
"log" | |
"runtime" | |
"sync/atomic" | |
"time" | |
) |