Skip to content

Instantly share code, notes, and snippets.

View punkrocker178's full-sized avatar
🎯
Focusing on angular4reddit.me

Hieu punkrocker178

🎯
Focusing on angular4reddit.me
  • Ho Chi Minh City
View GitHub Profile
@punkrocker178
punkrocker178 / drills.js
Created August 18, 2018 07:07
Thinkful Unit 2 Lesson 2 Jaavascript drills
/*-----------------------Drill 1----------------------*/
function wisePerson(wiseType, whatToSay) {
// your code here
var a = "A wise "+wiseType+" once said: \""+whatToSay+
"\".";
return a;
}
/* From here down, you are not expected to
@punkrocker178
punkrocker178 / numberDrills.js
Created August 18, 2018 07:18
Thinkful Unit 2 Lesson 2 Number drills
/*------------------------------Drill 1----------------------------*/
function computeArea(width, height) {
// your code here
return width*height;
}
/* From here down, you are not expected to
understand.... for now :)
@punkrocker178
punkrocker178 / logicDrills.js
Created August 18, 2018 07:49
Thinkful Unit 2 Lesson 3 Logic drills
/*-----------------------------------Drill 1-------------------------------*/
function doTrafficLights() {
var activeLight = getActiveLight();
// your code will replace this call
// to `console.log()`
if(activeLight==="red"){
turnRed();
}
else if(activeLight==="green"){
@punkrocker178
punkrocker178 / Links
Last active August 19, 2018 15:35
Thinkful Unit 2 Lesson 4 Array Drills
@punkrocker178
punkrocker178 / arrayLoops.js
Created August 20, 2018 15:22
Thinkful Unit 2 Lesson 4 Array&Loops Drills
https://jsbin.com/molimos/edit?html,js,console,output
https://jsbin.com/toyumed/edit?html,js,console,output
https://jsbin.com/telamiy/edit?html,js,console,output
@punkrocker178
punkrocker178 / objDrills.js
Created August 21, 2018 14:14
Thinkful Unit 2 Lesson 6 Object Drills 1
https://jsbin.com/lurosel/edit?html,js,console,output
https://jsbin.com/zorovip/edit?html,js,console,output
https://jsbin.com/cahoray/edit?html,js,console,output
https://jsbin.com/jidodef/edit?html,js,console,output
@punkrocker178
punkrocker178 / objDrills2.js
Created August 22, 2018 03:30
Thinkful Unit 2 Lesson 6 Object Drills 2
https://jsbin.com/covokoj/2/edit?html,js,output
https://jsbin.com/taxavab/edit?html,js,console,output
https://jsbin.com/govafuc/edit?html,js,console,output
https://jsbin.com/kezicus/edit?html,js,console,output
https://jsbin.com/xiwidog/edit?js,console,output
@punkrocker178
punkrocker178 / mostFrequentWord.js
Created August 22, 2018 04:03
Analyze a most frequent word program Thinkful Unit 2 Lesson 6
function getTokens(rawString) {
// NB: `.filter(Boolean)` removes any falsy items from an array
// .split : split words from to to an array,input of spliting is Regex.This Regex means ignore white space character and any other special characters like commas,semi-colon,exclamation marks,etc...
// .sort : sorting words in an alphabetical order.
return rawString.toLowerCase().split(/[ ,!.";:-]+/).filter(Boolean).sort();
}
function mostFrequentWord(text) {
var words = getTokens(text);
console.log(words);
@punkrocker178
punkrocker178 / Teamcity-docker-compose.yml
Last active November 3, 2020 02:52
Docker container related commands
version: '3.5'
services:
teamcity-server:
image: jetbrains/teamcity-server:latest
volumes:
- ./server/data:/data/teamcity_server/datadir
- ./server/log:/opt/teamcity/logs
ports:
- 8080:8111
@punkrocker178
punkrocker178 / index.html
Last active November 3, 2020 03:15
Generates random number on a fixed table (https://jsbin.com/qubuzoh)
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
button{
display:block;
height:60px;
width:100px;