Skip to content

Instantly share code, notes, and snippets.

View wilkie's full-sized avatar
☠️
screaming into the void

wilkie wilkie

☠️
screaming into the void
View GitHub Profile
@wilkie
wilkie / 00-description.md
Last active August 29, 2015 13:58
Disrupting ruby naming

Disrupting Ruby Naming

In the source files below, 'slash' means it is in a subdirectory. subdirectories are not allowed in gists. Find the source here

Let's say you, a native Spanish speaker, wanted to write some code and use a library, but you wanted it to be equally functional to a library that already exists, but have Spanish names. So far, our community has been focused on and expecting that everybody learn English. This is enforced in several places, but primarily in our programming languages. Let us be code librarians and ask ourselves: shouldn't we change that?

C

At first, I terrorized C's standard library by replacing the function names with those readable in Spanish. It was a good time.

@wilkie
wilkie / example.rb
Created April 22, 2014 00:41
A dynamic natural language translation layer for ruby... an example:
require :spaES # <-- Select the stdlib locale
require 'stdlib' # <-- import the stdlib
# The above will be automatically done in practice, but it is just listed here
# as an illustration. This is because after this point, you need to use the term
# importar to import.
# As in: importar 'some-library'
# Only THIS file uses the function name table in español. Other files and existing libraries
# assuming the original or a different natural language are functionally unaffected. It is
@wilkie
wilkie / gist:10cf0cf60f371f680d30
Created May 1, 2014 02:54
Messing with unicode "constants"
# ruby 2.0.0p353
module Kernel
def const_set(sym, value)
if sym.to_s.match /^[^A-Z]/
@@__cool_constants ||= {}
@@__cool_constants[sym] = value
else
super(sym, value)
end
@wilkie
wilkie / scripts.rb
Last active August 29, 2015 14:04
Prints different things depending on language interpreter.
"<?php error_reporting(E_ALL ^ E_NOTICE); /* \
"; //; # ";
if ("00"==false)
console.log("Hello from JavaScript!");
else // # */
if ("0"==false)
printf("Hello from PHP!\n");
else
printf("Hello from Ruby!\n");
//; end;
@wilkie
wilkie / episode_renamer.pl
Created February 5, 2010 05:03
Will rename media files consisting of episodes of a television series by using the epguides.com website.
#!/usr/local/bin/perl
# AUTHORS: Dave Wilkinson and Bradley D. Kuhlman
# PURPOSE: Will rename media files consisting of episodes of a
# television series by using the epguides.com website from
# some cryptic, yet commonly found when downloaded on the
# internet, format to be `## - Title` where ## is the episode
# number.
#!/usr/local/bin/perl
# AUTHORS: Dave Wilkinson and Bradley D. Kuhlman
# PURPOSE: Will rename media files consisting of episodes of a
# television series by using the epguides.com website from
# some cryptic, yet commonly found when downloaded on the
# internet, format to be `## - Title` where ## is the episode
# number.
@wilkie
wilkie / gist:426976
Created June 5, 2010 20:42 — forked from anonymous/gist:426965
Getting a tuple of inherited classes with templates in D.
class A {
int bar;
}
class B : A {
int foo;
}
class C : B {
}
#!/usr/bin/perl
use strict;
use LWP::Simple;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
use HTML::LinkExtor;
use HTML::Entities;
@wilkie
wilkie / base26.c
Created June 17, 2010 03:48 — forked from LindseyB/base26.c
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
char* toBase26(int num) {
char* str;
int length = 1;
int tmp = num;
@wilkie
wilkie / new.c
Created August 19, 2010 03:31 — forked from duckinator/new.c
#include <stdlib.h>
#include <stdio.h>
#define new(TYPE, ARGS...) ({\
TYPE *item = ( TYPE *)malloc(sizeof( TYPE )); \
item->init = &TYPE##Init; \
item->init(item, ARGS); \
item; \
})