Skip to content

Instantly share code, notes, and snippets.

0x95dbA27e55eE84740dF989299c1122418bC8A630
@blister
blister / LogDebug.js
Last active February 27, 2016 13:39
LogDebug API Examples
var LogDebug = require('LogDebug');
var ld = new LogDebug('YOUR_API_KEY');
ld.log('This is a simple log entry');
ld.log('This log entry has complex data', { user: 'Steve', isCustomer: false });
ld.error('Server error, send a text message!');
const int buzzerPin = 5;
// Length must equal the total number of notes and spaces
const int songLength = 18;
// Notes is an array of text characters corresponding to the notes
// in your song. A space represents a rest (no tone)
char notes[] = "cdfda ag cdfdg gf "; // a space represents a rest
@blister
blister / gist:7450475
Last active December 28, 2015 05:29 — forked from sehugunin/gist:7450449
<script type="text/javascript">
jQuery(function() {
jQuery('#WorkPhone').on('blur', function() {
if(jQuery(this).val().length > 0) {
jQuery.get('test.php', { 'WorkPhone': jQuery('#WorkPhone').val() }, function(data) {
if ( data == 'Phone is a probable landline' ) {
jQuery('#showDiv').fadeIn();
} else {
jQuery('#showDiv').fadeOut();
}
@blister
blister / gist:740829
Created December 14, 2010 18:19
Bash script to add a delay to the localhost interface on Linux machines
#!/bin/bash
# Copyright 2010 Eric Ryan Harrison <me@ericharrison.info>
# Inspired by:
# http://daniel.haxx.se/blog/2010/12/14/add-latency-to-localhost/
if [ -n "$1" ]
then
if [ "$1" = "off" ]
then
tc qdisc del dev lo root
var R = 6371; // km
var dLat = (lat2-lat1).toRad();
var dLon = (lon2-lon1).toRad();
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) *
Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c;
function change_style(val) {
$('#stylesheet_link').attr('href', 'css/' + val + '.css');
if ( val != 'blank' ) {
var w3val = val.substr(0,1).toUpperCase() + val.substr(1);
$('#css_link').attr('href', 'http://www.w3.org/StyleSheets/Core/' + w3val);
$('#css_link').html('http://www.w3.org/StyleSheets/Core/' + w3val);
} else {
$('#css_link').attr('href', 'http://ericharrison.info/w3styles/css/' + val + '.css');
$('#css_link').html('Unstyled');
}
<!-- UserPing [beta] Tracking Code -->
<a href="http://userping.com">
<img src="http://ping.userping.com/badge.png"
alt="get userping" title="get userping" />
</a>
<script type="text/javascript"
src="http://ping.userping.com/pinger.js">
</script>
<!-- End UserPing Tracking Code -->
function random_color() {
return '#' + (~~(Math.random() * 16777215)).toString(16);
}
#!/bin/bash
# this is the script you would use for generic GMail addresses..
echo "your_email@gmail.com"
echo "--------------------"
curl -u your_email@gmail.com:YOUR_PASSWORD --silent "https://mail.google.com/mail/feed/atom" | perl -ne \
'
print "Message Count: $1 \n\n" if /<fullcount>(.+?)<\/fullcount>/;
print (($title - 1) . ". $1 ") if /<title>(.+?)<\/title>/ && $title++;
print "(from $1)\n" if /<email>(.+?)<\/email>/;