- Copy the
PAnim.cs
class into your Unity3d project - You're done!
Animating Objects
# IPython magic to check for PEP8 compliance. | |
# Author: Juan Luis Cano <juanlu001@gmail.com> | |
"""IPython magic to check for PEP8 compliance. | |
To use it, type | |
```%load_ext pep8magic``` | |
and then |
using UnityEngine; | |
using System.Collections; | |
public class Extrap { | |
public static Quaternion Slerp(Quaternion q1, Quaternion q2, float t) | |
{ | |
float angle; | |
Vector3 axis; |
/// A "fractional part" function on f32s that does bitwise magic | |
/// on the representation of its argument. | |
pub fn frac(f: f32) -> f32 { | |
f32::from_bits(_frac(f.to_bits())) | |
} | |
/// A "fractional part" function that operates on a signed integer | |
/// representation of an IEEE single-precision floating point number. | |
fn _frac(i: u32) -> u32 { | |
// A floating point number consists of a sign bit, |
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
# ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
function ghc-pkg-clean() { | |
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
do | |
echo unregistering $p; ghc-pkg $* unregister $p | |
done | |
} | |
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place. |
Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
import serial | |
class Lifespan(object): | |
def __init__(self): | |
self.connect() | |
def connect(self): | |
self.port = serial.Serial('/dev/tty.IHP-Serialport', 19200, timeout=1) | |
while self.port.read(1) != '': |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"