-
Simplest intro to git by github and codeschool - Try Git
-
[Intro to github]
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 stringInp(string) { | |
var stringSep = string.split(""); | |
for (var i = 0; i < stringSep.length; i++ ) { | |
stringSep[i] = stringSep[i].charCodeAt(0).toString(2); | |
} | |
return stringSep; | |
} | |
stringInp("Bagus Juang").join(" "); |
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
// this function takes an array and double each component inside it | |
const double = (nums) => { | |
if(nums.length === 0) { | |
return [] | |
} else { | |
return [2 * nums[0]].concat(double(nums.slice(1, nums.length))) | |
} | |
} | |
console.log(double([1,2,3,4]), "should be [ 2, 4, 6, 8 ]") |
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
// @flow | |
type ItteratorFunction = (key: string, value: mixed) => void; | |
type DataItem = { | |
key: string; | |
value: mixed; | |
}; | |
type Data = { | |
[key: string]: DataItem; |
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
type product = { | |
category: string, | |
price: string, | |
stocked: bool, | |
name: string | |
}; | |
type products = list(product); | |
let products = [ |
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 Utils = { | |
let rec repeat = (whatToRepeat, howManyTimes) => | |
switch howManyTimes { | |
| 0 => "" | |
| someNumber when howManyTimes > 0 => whatToRepeat ++ repeat(whatToRepeat, howManyTimes - 1) | |
| _ => "" | |
}; | |
let rec makePairFromList = (xs) => | |
switch xs { | |
| [] => [] |
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
let option_map = (fn, opt_value) => | |
switch (opt_value) { | |
| None => None | |
| Some(value) => Some(fn(value)) | |
}; | |
module View = { | |
[@bs.module "react-native-web"] | |
external _view : ReasonReact.reactClass = "View"; | |
let make = |
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
open Reprocessing; | |
let width = 640; | |
let height = 360; | |
let rec drawRec = (~x, ~y, ~dimension, env) => { | |
Draw.stroke(Constants.black, env); | |
Draw.strokeWeight(1, env); | |
Draw.noFill(env); | |
Draw.rect(~pos=(x, y), ~width=dimension, ~height=dimension, env); |
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
open Reprocessing; | |
module Constants = { | |
module Window = { | |
let width = 600; | |
let height = 600; | |
}; | |
module Color = { | |
let black = Constants.black; |
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
async function getUsersAsync(dispatch) { | |
dispatch({ type: "FETCH_REQUESTED" }); | |
try { | |
let data = await fetch("https://api.github.com/users").then(res => | |
res.json() | |
); | |
dispatch({ type: "FETCH_SUCCEED", data }); | |
} catch (error) { | |
dispatch({ type: "FETCH_FAILED", error: error }); | |
} |
OlderNewer