Skip to content

Instantly share code, notes, and snippets.

@netj
netj / memusg
Last active June 25, 2024 17:39
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@madmax
madmax / gist:1474059
Created December 13, 2011 21:54
changing font in textmate 2
1. Open Bundle editor
2. Select Themes -> Themes -> your theme
3. add to settings
fontName = 'Monaco';
fontSize = '12px';
or what you want, enjoy :)
@baopham
baopham / RunScript.scpt
Created February 22, 2012 18:29
Textmate's Python bundle modified script to run in iTerm
#!/bin/bash
TPY=${TM_PYTHON:-python}
esc () {
STR="$1" ruby <<"RUBY"
str = ENV['STR']
str = str.gsub(/'/, "'\\\\''")
str = str.gsub(/[\\"]/, '\\\\\\0')
print "'#{str}'"
RUBY
@timabell
timabell / vs-bash-console.bat
Created May 7, 2012 11:59
batch script for loading git-bash and the vs tools in the same window
@echo off
REM batch script for loading git-bash and the vs tools in the same window
REM inspiration: http://www.drrandom.org/post/2011/11/16/Grappling-with-multiple-remotes-in-git-tfs.aspx
RME screenshot: https://twitter.com/#!/tim_abell/status/199474387731226624/photo/1
%HOMEDRIVE%
cd %HOMEPATH%
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
echo Use full exe names when running under bash, e.g. "msbuild.exe"
echo Loading bash, you may now use git and msbuild in the same console \o/.
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
@rpmuller
rpmuller / svg-display.ipynb
Last active January 23, 2019 05:53
IPython's SVG display functionality, in conjunction with the ease of making SVG strings using ElementTrees, makes it really easy to have a nice drawing canvas inside of IPython.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mutterer
mutterer / RoiClassesTest.ijm
Last active April 3, 2019 21:57
A sample image menu macro that allows manually assigning classes to ROIs
var tags = newArray("nucleus-1","nucleus-2","cyto-1", "cyto-2");
var colors = newArray("red", "green", "blue", "magenta");
var commands = newArray("Select by tag...");
var menu = Array.concat(commands, tags);
var pmCmds = newMenu("Popup Menu", menu);
macro "Popup Menu" {
cmd = getArgument();
if (cmd=="Select by tag...") {
Dialog.create("Title");
@mitchwongho
mitchwongho / Docker
Last active June 26, 2024 07:28
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@UnaNancyOwen
UnaNancyOwen / PCL1.10.0.md
Last active May 7, 2024 04:29
Building PCL with Visual Studio
@somada141
somada141 / ipython_notebook_vtk.md
Last active January 31, 2022 20:36
Display VTK renders into IPython Notebook #python #visualization #vtk #ipython #ipythonnotebook

This function takes a renderer and displays the output directly into IPython

def vtk_show(renderer, w=100, h=100):
    """
    Takes vtkRenderer instance and returns an IPython Image with the rendering.
    """
    renderWindow = vtkRenderWindow()
    renderWindow.SetOffScreenRendering(1)
 renderWindow.AddRenderer(renderer)
@jakevdp
jakevdp / discrete_cmap.py
Last active July 2, 2024 09:43
Small utility to create a discrete matplotlib colormap
# By Jake VanderPlas
# License: BSD-style
import matplotlib.pyplot as plt
import numpy as np
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""