Skip to content

Instantly share code, notes, and snippets.

View eyy's full-sized avatar

Etai Peretz eyy

  • Israel
View GitHub Profile
@eyy
eyy / dot.js
Created June 2, 2015 11:07
dot path; dot({ prop: { inner: 1 } }, 'prop.inner') == 1
// dot path; dot({ prop: { inner: 1 } }, 'prop.inner') == 1
function dot (o, path) {
if (!path)
return o
var p = path.split('.')
while (p.length > 0) {
o = o[p.shift()]
if (o == undefined)
break
@eyy
eyy / click-all-images.js
Created June 10, 2015 23:09
click on all images
[].map.call(document.querySelectorAll('img'), function(el) { el.click() })
@eyy
eyy / rout-example.html
Last active August 29, 2015 14:25
Rout.js – DOM Router
<style>
route {
display: block;
background: yellow;
}
route[path] {
display: none;
}
</style>
@eyy
eyy / tasks.js
Last active August 29, 2015 14:26
Takser – node task runner
function first () {
console.log(1)
}
function second () {
console.log(2)
}
function three (val) {
@eyy
eyy / ftp-deploy.js
Created August 4, 2015 10:01
Deploy static site to FTP
console.log('connecting ftp...')
var FTP = require('jsftp'),
async = require('async')
var ftp = new FTP({
host: '',
port: 21,
user: '',
pass: '',
@eyy
eyy / media-query-mixins.styl
Created August 4, 2015 13:13
Media query mixins for Stylus
// Media query mixins
mobile()
@media (max-width: 640px)
{block}
tablet()
@media (max-width: 800px)
{block}
@eyy
eyy / package.json
Last active August 29, 2015 14:27
My `package.json` scripts
{
"scripts": {
"start": "node ./server/www",
"test": "faucet",
"front": "npm run bs & npm run stylus",
"back": "npm run nodemon & npm run stylus",
"build": "npm run stylus-build",
"deploy": "npm run build && node tasks deploy",
"bs": "browser-sync start --server --no-online --startPath=\"pub/index.html\" --files=\"pub/*.html, pub/css/*.css\"",
"stylus": "stylus -w -u nib -u jeet -u autoprefixer-stylus --sourcemap-inline pub/css/*.styl",
var arg = _.partial(_.includes, process.argv.slice(2))
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>GitHub Users, A Selection</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<style>
body {
@eyy
eyy / drop-right.html
Created May 28, 2019 08:12
Drop-right: a simple dropdown to the right
<div>
<ul>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li>
3 +
<ul class="drop-right">
<li><a href="#">3.1</a></li>
<li><a href="#">3.2</a></li>
<li>