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
# Reset | |
Color_Off='\e[0m' # Text Reset | |
# Regular Colors | |
Black='\e[0;30m' # Black | |
Red='\e[0;31m' # Red | |
Green='\e[0;32m' # Green | |
Yellow='\e[0;33m' # Yellow | |
Blue='\e[0;34m' # Blue | |
Purple='\e[0;35m' # Purple |
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
// visit localhost:3000/test/demo.html | |
// run this snippet from chrome dev tools sources panel | |
agent = new Agent(); | |
userIds = agent.makeIds('users', 2); | |
agent.group('users', function() { | |
this.fixture(userIds[1], { first: 'Joey', last: 'Trapp' }); | |
this.fixture(userIds[2], { first: 'Lee', last: 'Forkenbrock' }); | |
}); |
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
App.ApplicationController = Em.Controller.extend({ | |
notifictions: Blocks.Notifications.create(), | |
actions: { | |
notify: function() { | |
if (typeof obj === 'string') { | |
obj = { message: obj }; | |
} | |
this.get('notifications').createNotification(obj); | |
}, |
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> | |
<title>z-index test</title> | |
<style> | |
body { | |
z-index: 100; | |
background: white; | |
} | |
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
{ | |
"name": "name", | |
"version": "0.0.1", | |
"description": "desc", | |
"main": "index.js", | |
"scripts": { | |
"test": "make test", | |
"preinstall": "find vendor -type d -maxdepth 1 | tail -n 2 | cut -c8- | xargs -L 1 -I {} rm -f node_modules/{}", | |
"postinstall": "find vendor -type d -maxdepth 1 | tail -n 2 | cut -c8- | xargs -L 1 -I {} sh -c 'ln -s \"$(pwd)/vendor/{}\" node_modules/{}; cd vendor/{} && npm install'" | |
}, |
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 App extends React.Component { | |
constructor() { | |
super(); | |
this.state = { showPicker: true }; | |
} | |
componentDidUpdate() { | |
console.log(document.querySelectorAll(".pika-single")); | |
} |
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
[@react.component] | |
let make = (~className="", ~onSelect, ~children) => { | |
let fileInputRef: ReactDOMRe.Ref.currentDomRef = | |
React.useRef(None->Js.Nullable.fromOption); | |
let key = React.useRef(1); | |
let handleInputChange = | |
React.useCallback0(event => { | |
let files = ReactEvent.Form.target(event)##files; |
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
Mix.install( | |
[ | |
{:phoenix_playground, "~> 0.1.6"}, | |
{:phoenix_test, "~> 0.3.2"} | |
], | |
config: [ | |
phoenix_test: [endpoint: Demo.Endpoint], | |
phoenix_playground: [ | |
{Demo.Endpoint, | |
[ |
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
-module(aoc). | |
-export([main/1]). | |
-import(file, [read_file/1]). | |
-import(lists, [unzip/1, map/2, zip/2, sort/1, foldl/3, filter/2, sum/1]). | |
-import(maps, [get/3, update_with/4]). | |
-import(string, [is_empty/1, split/3, trim/1]). | |
main([Path]) -> |
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
-module(aoc). | |
-export([main/1]). | |
main([Path]) -> | |
{ok, Data} = parse(Path), | |
io:format("Safe: ~p~n", [lists:sum(lists:map(fun is_safe/1, Data))]), | |
io:format("Dampened: ~p~n", [lists:sum(lists:map(fun is_less_safe/1, Data))]), | |
erlang:halt(0). |