I hereby claim:
- I am jsvnm on github.
- I am jsvnm (https://keybase.io/jsvnm) on keybase.
- I have a public key ASDpUZWCekX4ulTSB3PFEhm2QyRaE_o08BBjv6wPuQ7PKwo
To claim this, I am signing this object:
| # git clone from https://github.com/tkarras/progressive_growing_of_gans | |
| # download the snapshot from their Google drive | |
| # use the following code in the same directory to generate random faces | |
| import os | |
| import sys | |
| import time | |
| import glob | |
| import shutil | |
| import operator | |
| import theano |
I hereby claim:
To claim this, I am signing this object:
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| require 'appscript' | |
| require 'titleize' | |
| def set_tags_from_filename(track) | |
| f=track.location.get.path.split('/')[-1] | |
| m=f.match(/(\d\d) (.+?) - (.+?)\.mp3/); | |
| track.track_number.set m[1] | |
| track.artist.set m[2].titleize | |
| track.name.set m[3].titleize |
| private static class Boxed<T> { | |
| internal static readonly Converter<object, T> PleaseComeOut = Boxed<T>.Delivers(typeof(T)); | |
| private static Converter<object, T> Delivers(Type type) { | |
| if (type.IsValueType) return new Converter<object, T>(Boxed<T>.Contents); | |
| throw new InvalidOperationException("No thanks"); | |
| } | |
| private static T Contents(object value) { return (T) value; } | |
| } |
| require "color"; | |
| class Hex2InvertedHSL | |
| def initialize; @convs={}; end; | |
| def do(line) | |
| line.gsub(/#[0-9a-fA-F]{6}/) { |hex| | |
| @convs[hex] || (@convs[hex]=conv(hex)) | |
| } | |
| end |
| (defun move-next-end-of-line (arg) | |
| "if at eol go to next line. in any case go to eol." | |
| (interactive "^p") | |
| (when (eolp) | |
| (next-line)) | |
| (move-end-of-line arg)) | |
| (global-set-key (kbd "C-S-e") 'move-next-end-of-line) |
| // original from http://www.scottlogic.co.uk/blog/colin/2010/03/linq-to-visual-tree/ | |
| using System; | |
| using System.Linq; | |
| using System.Collections.Generic; | |
| using System.Windows; | |
| using System.Windows.Media; | |
| namespace LinqToVisualTree | |
| { |
| for r in `git branch -r | grep -v HEAD`; do b=${r#origin/}; git branch --track $b $r; done |
| # from http://www.physics.sfasu.edu/astro/color/spectra.html | |
| def rgbFromWavelength(wl, gamma=0.8) | |
| rgb=case wl | |
| when (380..439); [-1.0*(wl-440.0)/(440.0-380.0), 0.0, 1.0] | |
| when (440..489); [0.0, (wl-440.0)/(490.0-440.0), 1.0] | |
| when (490..509); [0.0, 1.0, -1.0*(wl-510.0)/(510.0-490.0)] | |
| when (510..579); [(wl-510.0)/(580.0-510.0), 1.0, 0.0] | |
| when (580..644); [1.0, -1.0*(wl-645.0)/(645-580.0), 0.0] | |
| when (645..780); [1.0, 0.0, 0.0]; |