Skip to content

Instantly share code, notes, and snippets.

View joelklabo's full-sized avatar
Zapping

klabo joelklabo

Zapping
View GitHub Profile
@joelklabo
joelklabo / setup.sh
Last active May 10, 2023 15:56
VM Setup for CLN Plugin Development
sudo apt-get update
sudo apt-get install -y \
autoconf automake build-essential git libtool libgmp-dev libsqlite3-dev \
python3 python3-pip python3-mako net-tools zlib1g-dev libsodium-dev gettext \
nodejs npm
pip3 install --upgrade pip
pip3 install --user poetry
sudo apt-get install snapd
sudo snap install bitcoin-core
@joelklabo
joelklabo / gist:9c5a066a91d951654f1648cca03111d6
Created August 29, 2021 19:27
lnprototest test output running against c-lightning
joel@lightning:~/code/lnprototest$ make check PYTEST_ARGS='--runner=lnprototest.clightning.Runner'
pytest --runner=lnprototest.clightning.Runner
========================================================== test session starts ==========================================================
platform linux -- Python 3.8.10, pytest-6.1.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/joel/code/lnprototest
plugins: rerunfailures-9.1.1, flaky-3.7.0, timeout-1.4.2, xdist-2.2.1, forked-1.3.0
collected 26 items
tests/test_bolt1-01-init.py .. [ 7%]
tests/test_bolt1-02-unknown-messages.py . [ 11%]
//
// Shape_04ViewController.m
// Shape_04
//
// Created by test on 9/4/09.
// Copyright __MyCompanyName__ 2009. All rights reserved.
//
#import "Shape_04ViewController.h"
@joelklabo
joelklabo / latency.txt
Created September 14, 2012 03:38 — forked from nahurst/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers Time Light Distance Approximate Light Distance
-------------------------- ---- -------------- --------------------------
L1 cache reference 0.5 ns 0.15 m Diagonal across your smartphone
Branch mispredict 5 ns 1.5 m Height of Natalie Portman
L2 cache reference 7 ns 2.1 m Height of Shaq
Mutex lock/unlock 25 ns 7.5 m Height of a school flag pole
Main memory reference 100 ns 30 m Half a Manhattan city block (North/South)
Compress 1K bytes with Zippy 3,000 ns 900 m Width of Central Park
Send 1K bytes over 1 Gbps network 10,000 ns 3,000 m Width of Manhattan
Read 4K randomly from SSD* 150,000 ns 45,000 m NYC to Hempstead on Long Island
FROM THIS:
describe('.setCurrentUser', function (){
it('creates message types for the user', function (){
yam.setCurrentUser({
id: 1
, attachments: [
{ app_id: 'praise', name: 'foo' }
, { app_id: 'polls', name: 'bar' }
// Logging 'load' event
this._yammerClient.reportEvent({
success: function(data){ console.log('successfully logged "load"') },
error: function(data){ console.log('failed to log', data) },
data: {
events: yam.json.stringify([{ name: 'desktop_session', properties:
{ type: 'load',
version: this._settings._config.siteVersion.current
}
}])
if (!params.type || (params.type == 'following' && yam.currentUser.treatments.algo_feed)) {
// users may have hardlinked /threads/index?type=following
// so we want to check and show the preferred feed instead
params.type = yam.currentUser.getPreferredFeedType();
}
" Completion menu: completes based on text of current file, as well as other
" open buffers/windows. Use <Tab> to open the menu (or pick another key, see
" the last line), as well as to cycle between the different options. Use
" <Enter> or <Space> to use use option.
set complete=.,w,b
set completeopt=longest,menu,menuone,preview
function! AutoCompleteOnKey(key)
if pumvisible() " menu open, loop through choices
return "\<Down>"
else " menu not open, open conditionally
<script type="text/javascript">
Event.observe(document,'dom:loaded',function(){
var flashvars = {};
flashvars.appname = '<%= SITE_NAME %>';
flashvars.appurl = '<%= site_with_protocol %>/desktop/Yammer.air';
flashvars.airversion = '1.5.3';
flashvars.imageurl = "/images/desktop_badge.png";
flashvars.jsonclickcallback = function(){ window.location = '<%= site_with_protocol %>#/Threads/index?type=following' };
var params = {};
params.bgcolor = "#FFFFFF";
@joelklabo
joelklabo / npm uninstall error
Created February 22, 2011 01:02
I messed something up
joel@macbuntu:~/src/npm$ sudo make uninstall
node cli.js cache clean
npm info it worked if it ends with ok
npm info using npm@0.2.18
npm info using node@v0.4.2-pre
npm ERR! sudon't!
npm ERR! sudon't! Running npm as root is not recommended!
npm ERR! sudon't! Seriously, don't do this!
npm ERR! sudon't!
npm ok