This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Math.round(0xFFFFFF * Math.random()).toString(16) + "000000").replace(/([a-f0-9]{6}).+/, "#$1").toUpperCase(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <string.h> | |
#include <stdio.h> | |
uint8_t outbuf[6]; | |
int cnt = 0; | |
int ledPin = 13; | |
int servoPin = 7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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;}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -rl --include=*.html "SOME_PATTERN" * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
du -sh |
OlderNewer