Skip to content

Instantly share code, notes, and snippets.


Almog Melamed Radagaisus

View GitHub Profile
slode /
Last active Jun 11, 2020
A faster numpy pad algorithm where the padding mode is symmetric along the axes.
MIT License
Copyright (c) 2017 Stian Lode,
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
mrdrozdov /
Last active Dec 28, 2018
Logging in Tensorflow
from tf_logger import TFLogger
""" Example of using TFLogger to save train & dev statistics. To visualize
in tensorboard simply do:
tensorboard --logdir /path/to/summaries
This code does depend on Tensorflow, but does not require that your model
is built using Tensorflow. For instance, could build a model in Chainer, then
igrigorik / json-bq-schema-generator.rb
Last active Nov 3, 2022
BigQuery JSON schema generator
View json-bq-schema-generator.rb
require 'open-uri'
require 'zlib'
require 'yajl'
# References
# -
# -
def type(t)
heuristicfencepost /
Created Jul 10, 2012
GEB MIU system in various languages
# Simple implementation of the productions for the MIU system
open INFILE,"<",$ARGV[0];
while(<INFILE>) {
next if $_ =~ /#.*/;
print "$1IU\n" if $_ =~ /^(.+?)I$/;
print "M$1$1\n" if $_ =~ /^M(.+)$/;
print "$1U$2\n" if $_ =~ /^(.*)III(.*)$/;
print "$1$2\n" if $_ =~ /^(.*)UU(.*)$/;
czottmann / example.js
Created Apr 16, 2012
Underscore.template: Super-simple/-stupid partials. It's quick and dirty yet it does what I want, so there.
View example.js
// Fetch the template HTML from the DOM, hand it over to `Underscore.template`,
// assign some variables, and set up a `partial` method.
var template = $("#tmpl-main-section").html(),
compiledTemplate = _.template( template, {
models: aCollectionOfThings,
// See template examples below on usage. It's all very complex.
partial: function( partialName, variables ) {
return _.template(
$( "#tmpl-" + partialName ).html(),
jimbojsb / gist:1630790
Created Jan 18, 2012
Code highlighting for Keynote presentations
View gist:1630790

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

DanHulton / gist:993415
Created May 26, 2011 — forked from hashmal/gist:803816
Playing with CoffeeScript, do funny things with mixins.
View gist:993415
# Swappable Mixins in CoffeeScript
# ================================
# Many thanks to Hashmal, who wrote this to start.
# Usage
# -----
# class Derp extends Mixin
hvr / gist:662196
Created Nov 4, 2010
Show key fingerprints of public keys in .ssh/authorized_keys file
View gist:662196
( while read L
do echo $L > /tmp/pubkey
printf "%-16s => " $(cut -f 3 -d ' ' /tmp/pubkey)
ssh-keygen -l -f /tmp/pubkey
rm /tmp/pubkey
) < .ssh/authorized_keys