Skip to content

Instantly share code, notes, and snippets.

View jimf99's full-sized avatar
💭
I may be slow to respond.

JimFyyc jimf99

💭
I may be slow to respond.
  • -na-
  • YYC = Calgary Alberta Canada airport code
View GitHub Profile
@ajfisher
ajfisher / colour_converter.py
Created May 30, 2012 06:56
Convert an 888 RGB value to 565 hex
# Author: Andrew Fisher
# Version: 0.1
# Date: 30/05/2012
# Licence: BSD
# This python converts an rgb value expressed in 8 bit values (eg 255, 128, 0) and returns a hex value that
# has been converted to 565 format. This was highly useful when I was playing with some Arduino
# stuff requiring 16 bit LCD designs and couldn't remember the hex layout.
def rgb_hex565(red, green, blue):
@chrismeyersfsu
chrismeyersfsu / oscilloscope.c
Last active January 7, 2024 14:15
Arduino Poor man's oscilloscope processing code
/*
* Oscilloscope
* Gives a visual rendering of analog pin 0 in realtime.
*
* This project is part of Accrochages
* See http://accrochages.drone.ws
*
* (c) 2008 Sofian Audry (info@sofianaudry.com)
*
* This program is free software: you can redistribute it and/or modify
@whichlight
whichlight / rangefinder_hcsr04.ino
Created September 23, 2012 15:49
rangefinder code hc-sr04
int pingPin = 13;
int inPin = 12;
void setup() {
Serial.begin(9600);
}
void loop()
{
// establish variables for duration of the ping,
# Tkinter and GPIO together
from Tkinter import *
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(24, GPIO.OUT)
GPIO.output(24, GPIO.LOW)
def toggle():
@ChrisManess
ChrisManess / csvParser.html
Created May 1, 2013 01:41
Reading a CSV file with HTML5's FileReader
<html>
<head>
<script>
// Check for the various File API support.
if (window.File && window.FileReader && window.FileList && window.Blob) {
// Great success! All the File APIs are supported.
} else {
@Dakuan
Dakuan / Simple Twitter Auth
Created July 1, 2013 11:01
Authenticate with the Twitter API using OAuth and Node.js
var OAuth2 = require('OAuth').OAuth2;
var https = require('https');
var oauth2 = new OAuth2(KEY, SECRET, 'https://api.twitter.com/', null, 'oauth2/token', null);
oauth2.getOAuthAccessToken('', {
'grant_type': 'client_credentials'
}, function (e, access_token) {
console.log(access_token); //string that we can use to authenticate request
var options = {
@robertcedwards
robertcedwards / gist:fcec06dc0904a438c6a8
Created November 3, 2014 21:35
onmouseover html5 video play, mouseout pause
<html>
<head>
</head>
<body>
<div style="text-align:center" onmouseover="Play()" onmouseout="Pause()">
<video id="video1" width="480">
<source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/mp4" />
<source src="http://clips.vorwaerts-gmbh.de/VfE_html5.ogg" type="video/ogg" />
Your browser does not support HTML5 video.
</video>
@ninewise
ninewise / bracket.js
Created November 7, 2014 16:42
Easy tournament bracket, double elimination
function Node() {
this.left = undefined;
this.right = undefined;
this.person = undefined;
};
function makeWinners(people, size) {
var root = new Node();
if(people.length === 1 && (size === 1 || size === 2)) {
<?php
/*
Name - templated.php
Author - Shafiq Mustapa ([email protected])
Usage - php templated.php
Stumble this upon site (http://templated.co)that offer over 800+ HTML5 + CSS + Responsive.
This php script will download the file automatically. For now, the page is now 7.
Tools
@dhhagan
dhhagan / print-timestamp-arduino
Created January 6, 2015 21:27
Print a timestamp to SD card on Arduino
/*
print_time() returns a string in the format mm-dd-yyyy hh:mm:ss
*/
#include "RTClib.h"
#include <SD.h>
#include <SPI.h>
RTC_DS1307 rtc;
const int chipSelect = 10;