Skip to content

Instantly share code, notes, and snippets.

//************************************************************************
// MSP430G2231 Demo - Timer_A, PWM TA1, Up Mode, SMCLK
//
// Description: This program generates one PWM output on P1.2 using
// Timer_A configured for up mode. The value in CCR0, 1000-1, defines the
// PWM period and the value in CCR1 the PWM duty cycles. Using SMCLK,
// the timer frequenciy is about 1.1kHz with a 25% duty cycle on P1.2.
// Normal operating mode is LPM0.
// MCLK = SMCLK = default DCO (about 1.1MHz).
//
@csete
csete / gist:813836
Created February 6, 2011 23:46
Arduino code to read TMP102 temp sensor and MPX4115A pressure sensor.
/* The setup for this code:
http://www.oz9aec.net/index.php/arduino/343-mpx4115a-pressure-sensor-with-arduino
*/
#include <LiquidCrystal.h>
#include <Wire.h>
#define kpa2atm 0.00986923267
// initialize the LCD library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
@max-mapper
max-mapper / awesome.html
Created May 12, 2011 15:37
node-serialport + arduino + popcorn.js DIY video scrubber
<html>
<head>
<script src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script src="http://burritopizza.local/socket.io/socket.io.js"></script>
<script src="https://gist.github.com/raw/952547/f298c7e30d0978da0c78df0ff79436e883efbad2/gistfile1.txt"></script>
<script src="http://popcornjs.org/code/players/youtube/popcorn.youtube.js"></script>
<style type='text/css'>
body {
}
@atduskgreg
atduskgreg / arduino_firmware.cpp
Created November 8, 2011 20:52
send multiple values over serial from Processing to Arduino
int currentValue = 0;
int values[] = {0,0};
void setup() {
Serial.begin(9600);
}
void loop() {
if(Serial.available()){
@gre
gre / easing.js
Last active April 13, 2025 15:13
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
1. Open terminal inside your virtual machine and run:
sudo dd if=/dev/zero of=EMPTY bs=1M
sudo rm ./EMPTY
This will zeroify all the empty blocks on your disk.
2. Shutdown you virtual box.
3. Check what type of virtual drive do you have: VMDK or VDI. VirtualBox shrinking works only with VDI files.
If you have a VDI file, proceed to the last step, otherwise you'll need to perform an additional step of converting your VMDK file
Index: evrouter.c
===================================================================
--- evrouter.c (revision 15)
+++ evrouter.c (working copy)
@@ -78,6 +78,7 @@
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/extensions/XTest.h>
+#include <X11/XKBlib.h>
@slinkp
slinkp / sched_icalendar.py
Created May 30, 2012 19:06
Convert PyGotham schedule into iCal format
"""
Parse the pygotham json schedule and make ical output
for use w/ google calendar, etc.
NOTE if you are going to serve the result, apparently google cal won't parse
it unless the header Content-Type: text/calendar is set!
Really useful for testing output: http://icalvalid.cloudapp.net
and http://severinghaus.org/projects/icv/
"""
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active April 16, 2025 07:11
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx