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
import Html exposing (..) | |
import Html.App as Html | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (onInput) | |
import String | |
import Markdown | |
main = | |
Html.beginnerProgram | |
{ model = model |
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
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (..) | |
import Html.App as App | |
type CellType | |
= String | |
| Int | |
| Bool |
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
import Html exposing (..) | |
import Html.Events exposing (..) | |
import Html.Attributes exposing (..) | |
import Random | |
main = | |
Html.program | |
{ init = init |
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
import Html exposing (..) | |
import Char | |
main = text <| sluggify "Sluggify's Example String!" | |
sluggify : String -> String | |
sluggify string = | |
string | |
|> removeSpecialCharacters |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>VueJS | Scrollspy</title> | |
<style type="text/css"> | |
body { | |
margin: 0; | |
font-family: Arial; |
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
/* Input: | |
{ | |
"person.name.first": "Ryan", | |
"person.name.last": "Haskell-Glatz", | |
"person.age": 23 | |
} | |
... undottify magic ... | |
Output: | |
{ | |
"person": { |
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
const getRange = (start, end) => { | |
let list = [] | |
if (start <= end) { | |
for (let i = start; i <= end; i++) | |
list.push(i) | |
} | |
return list | |
} | |
const RepeatableField = (fields, prefix) => ({ |
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
Vue.component('List', { | |
data: () => ({ | |
names: [ | |
'Ryan', | |
'Alexa', | |
'Jimmy' | |
] | |
}) | |
}) |
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
Vue.component('List', { | |
template: ` | |
<div class="list"> | |
<item v-for="name in names" v-bind:name="name" /> | |
</div> | |
`, | |
data: () => ({ | |
names: [ | |
'Ryan', | |
'Alexa', |
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
const equals = (obj1, obj2) => { | |
const sortKeys = (obj) => | |
(obj && typeof obj === 'object') | |
? Object.keys(obj) | |
.sort((a, b) => a < b) | |
.reduce((newObj, key) => { | |
newObj[key] = sortKeys(obj[key]) | |
return newObj | |
}, {}) | |
: obj |
OlderNewer