Skip to content

Instantly share code, notes, and snippets.

View birkof's full-sized avatar
🤟

Daniel Stancu birkof

🤟
View GitHub Profile
/*
TempHumidityPrinter
(c) Colin Faulkingham 2011 - MIT license
Sparkfun Thermal Printer http://www.sparkfun.com/products/10438
Adafruit DHT11 Temp and Humidy Sensor https://www.adafruit.com/products/386
Sparkfun 16x2 LCD display http://www.sparkfun.com/products/9761
Arduino UNO SMD http://www.sparkfun.com/products/10356
// Read temperature/humidity from sensor and display on LCD screen
#include <SoftwareSerial.h>
#include <Sensirion.h>
#define lcdTxPin 2
#define sensorDataPin 3
#define sensorClockPin 4
float temperature;
@birkof
birkof / blinky.js
Created March 27, 2012 09:26 — forked from aaronpowell/blinky.js
How to implement blink with jQuery
(function($) {
$.fn.blinky = function(args) {
var opts = { frequency: 1e3, count: -1 };
args = $.extend(true, opts, args);
var i = 0;
var that = this;
var dfd = $.Deferred();
function go() {
if(that.length == 0) {
return dfd.reject();
@birkof
birkof / url_exists.php
Created December 19, 2011 08:59
Check if a file exists in another server ...
if(!function_exists('url_exists')) {
function url_exists($url) {
$hdrs = @get_headers($url);
return is_array($hdrs) ? preg_match('/^HTTP\\/\\d+\\.\\d+\\s+2\\d\\d\\s+.*$/',$hdrs[0]) : false;
}
}
@birkof
birkof / makeUri.js
Created November 16, 2011 00:26 — forked from niallsmart/makeUri.js
makeUri.js - create a URI from an object specification
// makeURI 1.2.2 - create a URI from an object specification; compatible with
// parseURI (http://blog.stevenlevithan.com/archives/parseuri)
// (c) Niall Smart <niallsmart.com>
// MIT License
function makeUri(u) {
var uri = "";
if (u.protocol) {
uri += u.protocol + "://";
@birkof
birkof / trixtercanada
Created September 26, 2011 15:00
trixtercanada
window.onscroll = function() {
if (document.documentElement.scrollTop > 500 || self.pageYOffset > 500) {
$('#sidebar').css({'position':'fixed', 'top':'10px', 'left':'946px'});
} else {
$('#sidebar').css({'position':'absolute', 'top':'500px', 'left':'650px'});
}
}
@birkof
birkof / ajaxify-html5.js
Created September 13, 2011 13:50 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser