Skip to content

Instantly share code, notes, and snippets.

View porglezomp's full-sized avatar
💖
GITHUB DROP ICE

Cassie Jones porglezomp

💖
GITHUB DROP ICE
View GitHub Profile
@lynn
lynn / frac.rs
Last active March 19, 2020 15:35
A bitwise-magic fractional part function
/// 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,

Homestuck Uses Discord

The Beta Kids

  • John - Is the owner, but doesn't really know how to run a server.
  • Rose - The only one with a good internet connection and a good mic. Always on topic.
  • Dave - Shitposter. Exclusively posts in #memes or if there is no meme channel, will post memes in every channel until one is made.
  • Jade - Pretty much everyone treats her like the actual owner of the server. Hangs out in #general to welcome newbies.

The Trolls

  • Karkat - Always in voice chat. His microphone is somehow the shittiest mic out of anyone.
@bishboria
bishboria / springer-free-maths-books.md
Last active March 22, 2024 11:19
Springer made a bunch of books available for free, these were the direct links
@porglezomp
porglezomp / README.md
Last active August 29, 2015 14:05
Do parametric animation in Unity3d, inspired by UIView animation in iOS

How to use this

Installation

  1. Copy the PAnim.cs class into your Unity3d project
  2. You're done!

Animating Objects

@porglezomp
porglezomp / Extrap.cs
Last active August 31, 2018 01:56
Provides some of Unity's interpolation methods without clamping to [0, 1]
using UnityEngine;
using System.Collections;
public class Extrap {
public static Quaternion Slerp(Quaternion q1, Quaternion q2, float t)
{
float angle;
Vector3 axis;
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) != '':
@astrojuanlu
astrojuanlu / pep8magic.py
Last active April 27, 2017 11:00
IPython cell magic to check for PEP8 using https://pypi.python.org/pypi/pep8
# 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
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active February 25, 2024 13:47
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

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"

Results

@iamatypeofwalrus
iamatypeofwalrus / roll_ipython_in_aws.md
Last active January 22, 2024 11:18
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
@simonmichael
simonmichael / gist:1185421
Created September 1, 2011 03:59
ghc-pkg-clean, ghc-pkg-reset
# 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.