This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void mouseDragged() { | |
if (mouseButton == RIGHT) { | |
float z = screenZ(k.x,k.y,k.z); | |
println(z); | |
PMatrix3D proj = ((PGraphics3D) this.getGraphics()).projection; | |
PMatrix3D transform = ((PGraphics3D) this.getGraphics()).modelview; | |
PMatrix3D a = transform.get(); | |
PMatrix3D b = proj.get(); | |
a.invert(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Bernát Kalló | |
email = [email protected] | |
[core] | |
askpass = /bin/echo | |
editor = vim | |
whitespace = off | |
pager = view - | |
[advice] | |
statusuoption = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git_ps1() { | |
GIT_PS1="$(__git_ps1)" | |
if [ "$GIT_PS1" ]; then | |
GIT_STATUS=$(git status --porcelain) | |
# if there are modified files | |
if echo "$GIT_PS1" | grep 'CONFLICT' > /dev/null; then | |
GIT_COLOR=31 | |
elif echo "$GIT_STATUS" | grep '^.M' > /dev/null ; then | |
GIT_COLOR=35 | |
# if there are unknown files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Sometimes you don't need a complex framework for your Processing sketch. | |
Just some stuff you can draw click and drag. | |
1. Copy-paste this code to a new tab in your sketch, and create subclasses of Stuff. | |
2. Add this code to your sketch: | |
class MainStuff extends Stuff { | |
void setup() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
body { | |
font-family: "Calibri", sans; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IRails - Run rails server and generator subcommands from the Rails console | |
# | |
# This is a solution based on http://blockgiven.tumblr.com/post/5161067729/rails-server | |
# Can be used to run rails server, rails generate from the Rails console thus | |
# speeding up Rails server startup to ~ 1 second. | |
# | |
# Usage: | |
# Rails.server to start the rails server | |
# Rails.generate to list generators | |
# Rails.generate "model", "user" to use a generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin | |
IGem - run gem executables with forking, thus save the loading time. Can be used to speed up Rails generate, Rails server startup or Rake from minutes to seconds. | |
Usage: | |
$ rails console | |
>> IGem.run "rake db:migrate" | |
>> IGem.run "rails server", wait: false | |
>> IGem.run "rake --tasks", fork: false |