Skip to content

Instantly share code, notes, and snippets.

@qrohlf
qrohlf / gist:5852656
Created June 24, 2013 19:16
Synchronize two Mathematica plots angle and position so they can be simultaneously rotated with the mouse
from: http://mathematica.stackexchange.com/questions/5375/extract-current-viewing-parameters-from-a-3d-view/5377#5377
{vp, vv} = Options[Graphics3D, {ViewPoint, ViewVertical}][[All, 2]];
Grid[{{Graphics3D[Cuboid[], ViewPoint -> Dynamic[vp],
ViewVertical -> Dynamic[vv]],
ParametricPlot3D[{Cos[u], Sin[u] + Cos[v], Sin[v]}, {u, 0,
2 Pi}, {v, -Pi, Pi}, ViewPoint -> Dynamic[vp],
ViewVertical -> Dynamic[vv]]}}]
@qrohlf
qrohlf / helloworld
Last active July 26, 2016 18:31
Ruby Hello World
  = 1
   =  + 
    =   *  + 
     =    *  
      =
[     *(   +  )+  ,
        =     *    + ,
         =     *    +    -  ,
        ,
        =        +    ,
one = 1
two = one+one
five = two*two+one
ten = five*two
hw = [ten*(five+two)+two,
hundred1 = ten*ten+one,
l = ten*ten+ten-two,
l,
hundred11 = hundred1+ten,
ten*two+ten+two,
puts "‮dlroW olleH"
@qrohlf
qrohlf / 2D-Clipping.md
Last active December 27, 2015 15:09
Quinn's 2d Clipping, packaged into a Gist. Read 2D-Clipping.md.

##Rad 2d Clipping To try it out:

git clone https://gist.github.com/7345132.git
cd 7345132 
acom Lab3.c Drawframework.c && ./a.out better_house.xy

Then click a convex clipping window with your mouse in a clockwise direction.

Click the red square in the upper right corner to finish the polygon and clip the house.

@qrohlf
qrohlf / gist:8090423
Created December 23, 2013 01:03
fix for OSX VLC subtitle crash
sudo chmod a+w /usr/X11/var/cache/fontconfig
heroku pg:reset --confirm appname DATABASE_URL
heroku run rake db:migrate && rake db:seed
@qrohlf
qrohlf / OSX-tweaks.md
Last active November 4, 2015 17:07
Disable/enable drop shadows in OSX screenshots
sudo killall -HUP mDNSResponder
# fancy git/heroku deployment script
# moved to https://github.com/qrohlf/dotfiles/blob/master/functions/booyah.sh