Skip to content

Instantly share code, notes, and snippets.

View clindsey's full-sized avatar

not important clindsey

  • haunting the internet
View GitHub Profile
@clindsey
clindsey / JavaScript Random Hex Color
Created July 23, 2008 23:27
JavaScript Random Hex Color
(Math.round(0xFFFFFF * Math.random()).toString(16) + "000000").replace(/([a-f0-9]{6}).+/, "#$1").toUpperCase();
#include <Wire.h>
#include <string.h>
#include <stdio.h>
uint8_t outbuf[6];
int cnt = 0;
int ledPin = 13;
int servoPin = 7;
String.prototype.jumble=function(){
var words=this.split(" ");
var outputs=[];
for(var i=0;i<words.length;i++){
var word=words[i];
var letters=word.split("");
var output="";
letters.pop();letters.shift();
var k=letters.length;
if(k==0){outputs.push(word);continue;};
Object.prototype.merge = function(other_object){
for(var i in this){
if(other_object[i]){
this[i]=other_object[i];
};
};
for(var i in other_object){
if(!this[i]){
this[i]=other_object[i];
};
/* Image Selection */
var images = document.images;
for(var i = 0; i < images.length; i++){
var img = images[i];
img.style.border = '2px dotted #CC0088';
img.onclick=function(event){
console.log(event.target.src);
return false;
};
};
function doEdgeDetectionAlgorithm(input, baseColor, grey) {
var output = context.createImageData(canvas.width, canvas.height);
var w = input.width, h = input.height;
var inputData = input.data;
var outputData = output.data;
var bytesPerRow = w * 4;
var pixel = bytesPerRow + 4; // Start at (1,1)
var hm1 = h - 1;
var wm1 = w - 1;
var d = new Date;
-module(echo).
-export([listen/1]).
-define(TCP_OPTIONS, [list, {packet, 0}, {active, false}, {reuseaddr, true}]).
-record(player, {name=none, socket, mode}).
listen(Port) ->
{ok, LSocket} = gen_tcp:listen(Port, ?TCP_OPTIONS),
Pid = spawn(fun() -> maintain_clients([]) end),
grep -rl --include=*.html "SOME_PATTERN" *
@clindsey
clindsey / suspend_session.sh
Created January 13, 2010 21:41
suspend session in Mac OS X 10.6
#!/bin/bash
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend