Skip to content

Instantly share code, notes, and snippets.

View zmughal's full-sized avatar
🌿
fiddling with attribute grammars.

Zaki Mughal [sivoais] zmughal

🌿
fiddling with attribute grammars.
View GitHub Profile
@peczenyj
peczenyj / README
Last active August 29, 2015 13:57
This script creates one fuse filesystem with one file, cat.jpg, with a random kitten image (from thecatapi.com)
NEW! you can install via cpan: https://metacpan.org/release/PACMAN/Acme-CatFS-0.001
1. you should install LWP::Simple and Fuse:Simple - use cpan or cpanm
2. you should configure the local fuse install to run as root or as common user
3. don't forget 'fusermount -u <mountpoint>' after finish the script
to install dependencies
you can use regular cpan OR cpanminus ( http://search.cpan.org/~miyagawa/App-cpanminus-1.7001/lib/App/cpanminus.pm )
@peczenyj
peczenyj / monads.pl
Last active August 29, 2015 13:57
Monads in Perl, with operator >>= , is it possible?
package Maybe;
use Moo::Role;
has value => (is => 'ro', required => 1);
use overload
'>>='=> \&bind;
sub bind {
@robinhouston
robinhouston / wilson.c
Last active September 7, 2023 03:28
Another method for generating “all RGB” images
// gcc -g -Wall --std=c99 wilson.c -lpng -o wilson && ./wilson
/* Generate a random spanning tree of the RGB cube, and a random
spanning tree of the pixel grid, using Wilson's algorithm, then
do a simultaneous breadth-first search of these trees to obtain
a bijection between the RGB cube and the pixel grid.
Inspired by allrgb.com.
-- Robin Houston, 2014-03
#!/usr/bin/env perl
=pod
Using Mojolicious and L<MCE> for forked independant workers,
communicating via L<MCE::Queue>.
Run this with C<./mce_mojolicious.pl daemon>, then visit C<http://localhost:3000>.
There are 4 queues:
@landonf
landonf / strongtalk.md
Last active August 3, 2024 13:30
A brief list of Strongtalk papers

In considering where Objective-C could go, it's worthwhile to start by understanding the work that's already been done.

Below are a selection of papers from Gilad Bracha's 1990s work on Strongtalk, an extension of Smalltalk (from which Objective-C's design derives) with (among other things), stronger type-safety tooling.

What's interesting (to me, anyway), is that the work done on the Self/Strongtalk VM in the early 90s was actually bought by Sun and became the modern Java VM. When Google got started on their V8 JavaScript runtime, guess who shows up again — Lars Bak, who was the technical lead for both the Strongtalk and HotSpot Java VMs.

If we're going to be talking about how to apply "modern" (1990s!) ideas to Objective-C, we'd be wise to review the considerable work done in considering those sorts of problems in a Smalltalk-derived universe, and lifting whatever good ideas we can, and discarding

@pneff
pneff / Back Template
Created February 14, 2014 08:33
Anki Card Type for multiple-choice
<div class="check-container"><span id="check"></span></div>
{{#Question}}
<p>{{Question}}</p>
{{/Question}}
{{#Image}}
<p class="image">{{Image}}</p>
{{/Image}}
@nosamanuel
nosamanuel / destructure.py
Created February 9, 2014 00:04
Destructuring bind in Python
import ast
import inspect
class destructure(object):
def __init__(self, target):
self.target = target
def __enter__(self):
# 1. Get the stack frame that called `destructure`
@rjbs
rjbs / rjbs.pl
Created February 1, 2014 19:29
BEGIN { unshift @INC, 'lib'; }
use 5.19.0;
use feature 'signatures';
use warnings;
no warnings 'experimental::signatures';
sub add ($x, $y = 0) { return $x + $y; }
use JSON::PP;
@XVilka
XVilka / TrueColour.md
Last active August 26, 2025 13:19
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@jvns
jvns / blogs.md
Last active April 16, 2020 09:34
Tech blogs I subscribe to