Skip to content

Instantly share code, notes, and snippets.

View AliceWonderland's full-sized avatar
:octocat:

Alice Chuang AliceWonderland

:octocat:
View GitHub Profile
@AliceWonderland
AliceWonderland / moodmap.html
Created November 6, 2016 01:25
MoodMap by Alice for Google I/O 2010
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>NBC Local Media Labs - Now</title>
<!-- NBC Streeter key ABQIAAAAoSzeMDMiOMkt-jxr8_rKERQUIMrGlWh_71tuok4jKj85JkbBzhT3ur0BfzrRKoZKL9l5tfdWM1hdoA -->
<!-- NBC LocalMediaLabs key ABQIAAAAoSzeMDMiOMkt-jxr8_rKERTqy0Wh1w9wKL2tZqSWsQEiKNCtcxQGg5Z42XKWomTbiL99SSrFgCYvUQ -->
@AliceWonderland
AliceWonderland / 1.1 Format the Unformatted.js
Created April 6, 2017 04:31 — forked from anonymous/1.1 Format the Unformatted.js
1.1 Format the Unformatted created by smillaraaq - https://repl.it/GtLZ/2
function unformatted() {
function innerFunction(count) {
while(count > 0) {
count--;
if(count===2) {
console.log("count is two!");
}
}
console.log("are we still in the inner func?");
}
@AliceWonderland
AliceWonderland / 1.2 CamelCase.js
Created April 6, 2017 04:32 — forked from anonymous/1.2 CamelCase.js
1.2 CamelCase created by smillaraaq - https://repl.it/GtLj/2
function undertocamel(undername) {
var camelCaseOutput = "";
var foundUnder = false;
for(var i = 0; i<undername.length; i++) {
// undername[i];
if (undername[i] === "_") {
foundUnder = true;
} else {
if (foundUnder) {
camelCaseOutput += undername[i].toUpperCase();
@AliceWonderland
AliceWonderland / 1.3 CleanCode.js
Created April 6, 2017 04:32 — forked from anonymous/1.3 CleanCode.js
1.3 CleanCode created by smillaraaq - https://repl.it/GtNN/3
function aFunction(num){
for(var i=0; i<num; i++){
if(i%2 === 0){
console.log("is even!");
}else{
console.log("is odd!");
}
console.log("current number is ", i);
}
}
@AliceWonderland
AliceWonderland / 2.1 isDivisible.js
Created April 6, 2017 04:33 — forked from anonymous/2.1 isDivisible.js
2.1 isDivisible created by smillaraaq - https://repl.it/GvFi/2
function isDivisible(num1, num2){
var output=num1%num2;//console.log(output);
if(num1===undefined || num2===undefined){
console.log("argument undefined");
return null;
}else if(output===0){
return true;
}
else{
return false;
@AliceWonderland
AliceWonderland / 2.2 Temperature Converter.js
Created April 6, 2017 04:34 — forked from anonymous/2.2 Temperature Converter.js
2.2 Temperature Converter created by smillaraaq - https://repl.it/GvIB/1
function converter(degrees){
var degreesCelsius = (degrees - 32) * (5 / 9);
var degreesKelvin = degreesCelsius + 273.15;
console.log(degrees + " degrees Fahrenheit");
console.log("equals " + degreesCelsius + " degrees Celsius");
console.log("equals " + degreesKelvin + " degrees Kelvin");
}
//converter(77);
function converter2(degrees){
@AliceWonderland
AliceWonderland / 2.3 Nickname Generator.js
Created April 6, 2017 04:34 — forked from anonymous/2.3 Nickname Generator.js
2.3 Nickname Generator created by smillaraaq - https://repl.it/GvJF/3
function nicknameGenerator(fullName){
var nickName="";
var fullNameTemp=fullName.toLowerCase();
if(fullNameTemp[2]==="a" ||
fullNameTemp[2]==="e" ||
fullNameTemp[2]==="i" ||
fullNameTemp[2]==="o" ||
fullNameTemp[2]==="u"){
//log 4 letters
nickName=fullName.slice(0,4);
@AliceWonderland
AliceWonderland / 2.4 Bactrian Camel Case.js
Created April 6, 2017 04:34 — forked from anonymous/2.4 Bactrian Camel Case.js
2.4 Bactrian Camel Case created by smillaraaq - https://repl.it/GvLL/5
function bactrianCase(message){
var resultMessage="";
for(i=0;i<message.length;i++){
if(i%2===0){
resultMessage+=message[i].toUpperCase();
}else{
resultMessage+=message[i].toLowerCase();
}
//(i%2===0) ? resultMessage+=message[i].toUpperCase() : resultMessage+=message[i].toLowerCase();
}
@AliceWonderland
AliceWonderland / 3.1 Count by M.js
Created April 6, 2017 04:35 — forked from anonymous/3.1 Count by M.js
3.1 Count by M created by smillaraaq - https://repl.it/GxOg/4
function count(n,m,direction){
//n is limit
//m is interval
//direction up or down
if(direction==="up"){
for(var i=m; i<=n; i+=m){
console.log(i);
}
}else{
@AliceWonderland
AliceWonderland / 3.2 FizzBuzz w Chelsea.js
Created April 6, 2017 04:36 — forked from anonymous/3.2 FizzBuzz w Chelsea.js
3.2 FizzBuzz w Chelsea created by smillaraaq - https://repl.it/GxRj/0
function fizzBuzz(num){
debugger;
for(var i = 1;i <= num ;i++){
if(!(i%3) && !(i%5)){
console.log('fizzbuzz');
} else if (!(i%3)) {
console.log('fizz');
} else if (!(i%5)) {
console.log('buzz');
} else {