Skip to content

Instantly share code, notes, and snippets.

View fastmail-jmap-quickstart.js
const fetch = require('node-fetch');
async function run() {
let username = "YOUR USERNAME HERE";
let password = "YOUR APP PASSWORD";
let authBasic = new Buffer(username + ':' + password).toString('base64');
let session = await (await fetch('https://jmap.fastmail.com/.well-known/jmap', {
headers: {
"Authorization": "Basic " + authBasic
}
})).json();
View fairyfloss.js
// fairyfloss theme for blink shell
black = '#5A5475';
red = '#F92672'; // x red
green = '#C2FFDF'; // x green
yellow = '#E6C000'; // x yellow
blue = '#C5A3FF'; // x blue
magenta = '#C5A3FF'; // x pink
cyan = '#C2FFDF'; // x cyan
white = '#F8F8F0'; // x light gray
View examineNaN.js
function examineNaN(x) {
const buf = new ArrayBuffer(8);
const view = new DataView(buf);
view.setFloat64(0, x);
let binStr = '';
for (let i = 0; i < 8; i++) {
binStr += ('00000000' + view.getUint8(i).toString(2)).slice(-8) + ' ';
}
View perf_zine.txt
find 27968 97997.204322: 707897 cycles:pp:
7fffc034eac7 read_extent_buffer ([kernel.kallsyms])
7fffc032e4f7 btrfs_real_readdir ([kernel.kallsyms])
7fff81229eb8 iterate_dir ([kernel.kallsyms])
7fff8122a359 sys_getdents ([kernel.kallsyms])
7fff81850fc8 entry_SYSCALL_64_fastpath ([kernel.kallsyms])
c88eb __getdents64 (/lib/x86_64-linux-gnu/libc-2.23.so)
View rustconf-talks.md

Talks I'd love to see at RustConf

hi! I'm on the RustConf program committee this year, so here is a quick list of talks I'd be interested in seeing submitted. These are just things I personally think are interesting and I certainly don't represent the program committee as a whole :). As of today I haven't seen talk proposals about any of these!

introduce a small part of the Rust compiler

I imagine a lot of Rust developers have never read any of the code in the Rust compiler (I haven't!). And I know the language is trying to bring in more contributors! So I think an awesome talk could be:

  • pick a small part of the Rust compiler (maybe a part you've contributed to!)
View gdb.md
% self  % total  name
 68.90    68.90  sleeping - ci/ruby-programs/day.rb
 10.33    10.33  black_panther - ci/ruby-programs/day.rb
  6.99     6.99  learn - ci/ruby-programs/day.rb
  6.89     6.89  eat - ci/ruby-programs/day.rb
  6.89     6.89  clean - ci/ruby-programs/day.rb
  0.00   100.00  block in <main> - ci/ruby-programs/day.rb
  0.00   100.00  <main> - ci/ruby-programs/day.rb
  0.00   100.00  <c function> - unknown
View ruby-allocator-count.py
#!/usr/bin/python
# to try this you'll need to edit in the name of your ruby binary and install bcc-tools
# bcc installation instructions are at https://github.com/iovisor/bcc/blob/master/INSTALL.md
from __future__ import print_function
from bcc import BPF
from time import sleep
import os
# load BPF program
View freeze-mac.c
#include <mach/mach_init.h>
#include <mach/port.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
int main() {
for (;;) {
pid_t pid = fork();
if (pid == 0) execv("/usr/bin/true", NULL);
View regexp_compilation.rb
require 'pathname'
SEPARATOR_PAT = Pathname::SEPARATOR_PAT
def chop_basename(path)
base = File.basename(path)
if /\A#{SEPARATOR_PAT}?\z/ =~ base
return nil
else
return path[0, path.rindex(base)], base
end
You can’t perform that action at this time.