Skip to content

Instantly share code, notes, and snippets.

@tupui
tupui / halton.py
Last active October 9, 2022 12:20
Halton Sequence in python
"""Halton low discrepancy sequence.
This snippet implements the Halton sequence following the generalization of
a sequence of *Van der Corput* in n-dimensions.
---------------------------
MIT License
Copyright (c) 2017 Pamphile Tupui ROY
@eric-hu
eric-hu / Open iterm tab here
Last active March 11, 2022 02:45
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder. To use: (1) Open Automator (2) Create a new service (3) Change "Service receives selected" drop downs to "Files or folders" in "Finder" (4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer:
@t-abe
t-abe / computational_cost_hook.py
Created April 28, 2017 09:14
Hook implementation to calculate roughly estimated computational cost of a given network for Chainer
from __future__ import print_function
import sys
import chainer
from chainer.utils import conv
class ComputationalCostHook(chainer.function.FunctionHook):
name = 'ComputationalCostHook'
#!/bin/sh
set -e
ssh='ssh'
ec2din="ec2-describe-instances"
while [ $# -gt 0 ]; do
case $1 in
-*)
if [ -z "$2" ]; then
break
@mduheaume
mduheaume / .gitignore
Created January 28, 2012 17:12
Git ignore file for unity projects
Temp/
Library/
obj/
*.svd
!Library/*.asset
!Library/AssetImportState
!Library/AssetVersioning.db
!Library/BuildPlayer.prefs
!Library/ScriptMapper
@TotallyGatsby
TotallyGatsby / gitignore Unity
Created June 18, 2012 06:15
Unity .gitignore file
#This is the git ignore file used in Duck Hunted
#Note that ! negates an ignore. We ignore everything in Library then
#un-ignore the metadata folder and some specific files
#Use at your own risk, this may totally destroy your project, but it worked for us
#NOTE: this will cause your collaborators to re-import assets periodically
Temp/*
Library/*
Build/*