Skip to content

Instantly share code, notes, and snippets.

View leto's full-sized avatar
🐉
The Blocks Must Flow

Duke Leto leto

🐉
The Blocks Must Flow
View GitHub Profile
@danaj
danaj / taks.pl
Created October 28, 2012 01:21
Simple AKS in Perl
#!/usr/bin/env perl
package Acme::Math::AKS;
use warnings;
use strict;
use Math::BigInt try => 'GMP';
use Math::BigFloat try => 'GMP';
# Technically we can get by without any of these functions
use Math::Prime::Util qw/primes next_prime euler_phi is_prob_prime/;
# A simple standalone Perl implementation of the AKS primality algorithm:
@igal
igal / .gitconfig
Created August 28, 2012 06:51
Git configuration
#---[ Includes ]--------------------------------------------------------
[include]
# Load private information from a separate file, e.g. name, email, global
# ignores, tokens, etc.
path = ~/.gitconfig.local
#---[ Settings ]--------------------------------------------------------
[core]
@donpdonp
donpdonp / btcwatch.js
Last active October 9, 2015 02:17
neuronbot btcwatch bitcoin price watch
function(msg) {
var override = false;
if(/^btcwatch/.test(msg.message)) {
override = true;
}
if(msg.type == "ticktock" || override ) {
var clockdate = override ? (Date.now()) : (Date.parse(msg.message))
var clock = new Date(clockdate)
/* every 5 minutes */
if(clock.getMinutes() % 5 == 0 || override) {
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@davelab6
davelab6 / fontforge-features.txt
Created July 20, 2012 11:28
FontForge Feature List
[IN PROGRESS - J HANNA] Mac Feature: Make transparent PNG icons in menus not crash FontForge
Mac Feature: Apply all fixes in https://github.com/ummels/homebrew/commit/a68fd6b241306d563c3600403e6e7eb56abe0921 to the git master.
HUGE Feature: Make the Python object environment compatible with RoboFab.
Huge feature: add an automatic bug reporting tool that gets source code line number traces from a crash and submits them to a crash mailing list automatically
Big feature: Make key bindings interactive, so when the user clicks and holds on a menu item and the presses a key chord, that key chord is bound to that menu item, and stored in the current theme file
@bhenerey
bhenerey / ideal ops.md
Created May 23, 2012 19:40
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

#!/usr/bin/perl
# Usage: upgrade-cpan.pl 5.14.0 | sort -u | cpanm
use strict;
use File::Find::Rule;
use JSON;
my $old = shift;
my @files = File::Find::Rule->file->name('install.json')->in("$ENV{HOME}/perl5/perlbrew/perls/perl-$old/lib/site_perl/$old");
for my $file (@files) {
@cotto
cotto / questions.txt
Created May 2, 2012 22:52
m0 memory questions
per-callframe constants segment layout:
constants segment starts with a list of fixed-width pointers. I/N entries are stored directly. S/P entries are pointers to later in the constants segment
The data segment has a couple options. It can be appended after the constants segment (either on the next page or immediately after), with the constants data being marked read-only. Alternately, it can just be another segment attached to a special register.
If callframes are analogous to subs, the constants and data segment can be analogous to lexical data.
If callframes are analogous to subs, how will recursion work?
* clone a callframe (when? before entering ( -> no state) or after entering (less waste, leftover state))
* need to work out calling conventions
@masak
masak / explanation.md
Last active April 10, 2025 16:42
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@btoone
btoone / curl.md
Last active December 8, 2024 05:16
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin