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 <EEPROM_Rotate.h> | |
EEPROM_Rotate EEPROMr; | |
#define DATA_OFFSET 10 | |
void setup() { | |
Serial.begin(115200); | |
delay(2000); | |
EEPROMr.size(4); | |
EEPROMr.begin(4096); |
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
# Quickly Find and Replace Text Across Multiple Files with One Command | |
perl -pi -w -e 's/SEARCH_FOR/REPLACE_WITH/g;' *.txt | |
# Find | |
find ~ -iname "screen*" | |
find ~ -iname "screen*" | more |
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
# Useful Git Commands | |
## oficial git cheet-sheat | |
https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf | |
https://github.com/git-tips/tips#everyday-git-in-twenty-commands-or-so | |
https://github.com/dictcp/awesome-git | |
#### Pretty Log | |
`git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative` |
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
app.directive('smartInputDirection', function () { | |
return { | |
restrict: "EA", | |
link: function ($scope, element, attrs) { | |
element.keyup(function () { | |
var thiVal = $(this).val().charAt(0) | |
, p = /^[\u0600-\u06FF\s]+$/; | |
if (p.test(thiVal)) { | |
element.css({ |
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
//https://dl.dropboxusercontent.com/u/17365636/web/jsGradient.js | |
jsgradient = { | |
inputA : '', | |
inputB : '', | |
inputC : '', | |
gradientElement : '', | |
// Convert a hex color to an RGB array e.g. [r,g,b] | |
// Accepts the following formats: FFF, FFFFFF, #FFF, #FFFFFF | |
hexToRgb : function(hex){ |
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
/* | |
Convert English Numbers to Persian in a web page | |
Behnam Emamian(www.BehnamEmamian.com) | |
*/ | |
String.prototype.toPersianDigit = function (a) { | |
return this.replace(/\d+/g, function (digit) { | |
var enDigitArr = [], peDigitArr = []; | |
for (var i = 0; i < digit.length; i++) { | |
enDigitArr.push(digit.charCodeAt(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
$.tmpl = function(input,dict) { | |
// Micro Mustache Template engine | |
String.prototype.format = function string_format(arrayInput) { | |
function replacer(key){ | |
var keyArr =key.slice(2,-2).split("."),firstKey = keyArr[0], SecondKey = keyArr[1]; | |
if (arrayInput[firstKey] instanceof Object){ | |
return arrayInput[firstKey][SecondKey]; | |
} | |
else{ | |
return arrayInput[firstKey]; |
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
/*! | |
* jQuery TextChange Plugin | |
* http://www.zurb.com/playground/jquery-text-change-custom-event | |
* | |
* Copyright 2010, ZURB | |
* Released under the MIT License | |
*/ | |
(function ($) { | |
$.event.special.textchange = { |