Skip to content

Instantly share code, notes, and snippets.

View easierbycode's full-sized avatar

▓▒░ ♔ Daniel ♔ ░▒▓ easierbycode

View GitHub Profile
<body oncontextmenu="event.preventDefault()">
</body>
rm -rf dist/app dist/assets/images dist/maps dist/scripts dist/styles && gulp build && cd dist && firebase deploy && cd .. && gulp serve
[{
"title": "Practice",
"practice": true,
"position": 1,
"random_questions": false,
"questions": [{
"position": null,
"question": "money",
"answer": "duck",
"language": "en"
[{
"title": "Practice",
"practice": true,
"position": 1,
"random_questions": false,
"questions": [{
"position": null,
"question": "صديق",
"answer": "منزل",
"language": "ar"
// practice
[
["money", "duck"],
["friend", "house"],
["clean", "socks"]
]
// non-practice
[
["night", "fast"],
@easierbycode
easierbycode / word-pair.js
Last active December 4, 2017 23:10
Mindcrowd
// function getParameterByName( name ){
// name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
// var regexS = "[\\?&]"+name+"=([^&#]*)",
// regex = new RegExp( regexS ),
// results = regex.exec( window.location.href );
// if( results == null ){
// return "";
// } else{
// return decodeURIComponent(results[1].replace(/\+/g, " "));
// }
@easierbycode
easierbycode / serve-web.sh
Created November 22, 2017 21:20
serve index.html page (on http://localhost:8000)
python3 -m http.server
class Restaurant {
constructor( name, city ) {
this.name = name;
this.city = city;
console.log( this.name + ' in ' + this.city );
}
}
let r = Reflect.construct(Restaurant, ["Pepper Palace", "Peoria"]);
class Foo extends Array {}
let arr = Foo.from(['zero','one','two','three'])
console.log( arr instanceof Foo )
// true
@easierbycode
easierbycode / fade-in.js
Last active October 4, 2017 19:43
utils for transitioning between game and DOM elements
function fadeIn(id,speed) {
var element = document.getElementById(id);
var op = 0.1; // initial opacity
element.style.visibility = 'visible';
element.style.opacity = op;
var timer = setInterval(function () {
if (op >= 1){
clearInterval(timer);
}
element.style.opacity = op;