This file contains hidden or 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
/** | |
Reverse a string | |
**/ | |
function reverseMe(int){ | |
return int.toString().split('').reverse().join(''); | |
} | |
reverseMe('albert') --> "trebla" |
This file contains hidden or 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
/** | |
Fibonacci sequence algorithm in JS | |
**/ | |
function fib(x){ | |
if (x === 0) return 0; | |
if (x === 1) return 1; | |
return fib(x - 1) + fib(x - 2) | |
} |
This file contains hidden or 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
/** | |
Compute the moving avarage, with window size; k = 3 | |
**/ | |
var values = [3,2,4,5,7,6,8,9]; | |
var size = 3; | |
function avarage(items, size){ | |
var tally = 0; | |
var total = []; | |
This file contains hidden or 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
// Sample Data from Backend Service | |
/* | |
[ | |
{ | |
"name": "Salsas R Us", | |
"inventory": { | |
"Ghost Chili Salsa": {"price": 7, "quantity": 17}, | |
"Mild Salsa": {"price": 4.5, "quantity": 0} | |
} | |
}, |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Tabs</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script> | |
<style> | |
* { padding:0; margin:0; } | |
html, body { | |
font-family:sans-serif; |
This file contains hidden or 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
class ContactList extends React.Component { | |
render() { | |
const people = [ | |
{"name": "albert"}, | |
{"name": "leart"}, | |
{"name": "liana"}, | |
{"name": "vjollca"} | |
]; | |
return <ol> |
This file contains hidden or 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
//Card Component | |
const Card = (props) => { | |
return ( | |
<div style={{margin: '1em'}}> | |
<img width="75" src={props.avatar_url}/> | |
<div style={{display: 'inline-block', marginLeft: 10}}> | |
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}> | |
{props.name} | |
</div> | |
<div>{props.company}</div> |
This file contains hidden or 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 add(a, b) { | |
return a + b; | |
} | |
function mul(a, b) { | |
return a * b; | |
} | |
function applyf(func) { | |
return function(a) { |
This file contains hidden or 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
.DS_Store | |
.svn/ | |
log | |
logs | |
modules | |
precompiled | |
project/project | |
project/target | |
target | |
tmp |
This file contains hidden or 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
PS1='->' | |
export PS1="___________________\n| \w @ \h (\u) \n| => " | |
export PS2="| => " | |
# Reload Bash Profile | |
alias reload='source ~/.bash_profile' | |
# Create a Blank Site Template in Dropbox | |
function proj() { cp -R /Users/{user}/Dropbox/site_template '.'; mv site_template $1; } |