Skip to content

Instantly share code, notes, and snippets.

View gist:2081667
def adc_voltage_to_ohms(adc_value):
v = (adc_value * 5.0)/4096.0
return -1000/((0.0174*v) - 0.925411808) -1000
def ohms_to_celcius(ohms):
return (ohms - 100) * (138.4 / 100.0)
View Projectile.pde
class Ball {
float angle = radians(50.0);
float velocity = 50.0;
float i = velocity * cos(angle);
float j = velocity * sin(angle);
int x = 10, y = 250;
float t = 0.1;
float deltaT = t;
int lastX = x, lastY = y;
View gist:175024
#!/usr/bin/env perl
use warnings; use strict; use Data::Dumper;
sub foo {
my ($ref1, $ref2) = @_;
my @arr1 = @{$ref1};
my @arr2 = @{$ref2};
print Dumper \@arr1;
print Dumper \@arr2;
View gotta-love.scala
val arr = Array(1, 2, 2, 3, 4, 5)
println("I drank a very fine beer, when I was " + (0 /: arr) { _+_ })
View Refresh images
<script>
setInterval(function() {
var images = document.getElementsByTagName('img');
for(var i = 0; i < images.length; i++) {
var image = images[i];
var source = image.src;
if( source.indexOf('?') != -1 ) {
source = source.substring(0, source.indexOf('?'));
}
image.src = source + '?' + Math.floor(Math.random()*1000000);
View open-changes-in-textmate.sh
for fname in `svn stat | grep ^M | awk '{print $2}'` ; do mate $fname ; done
You can’t perform that action at this time.