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
jQuery(document).ready(function($){ | |
$('iframe[src*="player.vimeo"]').each(function(){ | |
var id = $(this).attr("src").split("/").slice(-1)[0]; | |
$(this).addClass("video_id_"+id); | |
$(this).parent().addClass("vimeo_id_"+id); | |
$.ajax({ | |
type:'GET', | |
url: 'http://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/' + id +'.json', | |
jsonp: 'callback', | |
dataType: 'jsonp', |
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
<?php | |
// Face.com api licence | |
$FaceAPI_Key = '[enter your key]'; | |
$FaceAPI_Secret = '[enter your secret]'; | |
// Get image url | |
$imgSRC = urlencode($_GET['url']); | |
// cURL ALT method |
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
fetch('https://maps.googleapis.com/maps/api/geocode/json?address=10030®ion=US', { | |
method: 'get' | |
}).then((response) => response.json()) | |
.then((response) => { | |
let address = response.results[0].address_components.reduce((comps, comp) => { | |
let attr = comp.types[0]; | |
attr = (attr === 'administrative_area_level_2') ? 'county' : attr; | |
attr = (attr === 'administrative_area_level_1') ? 'state' : attr; | |
comps[attr + '_long'] = comp.long_name; | |
comps[attr + '_short'] = comp.short_name; |
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
// ==UserScript== | |
// @name Never Mind | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Removes suggested and sponsord posts on scroll! | |
// @author Ofraggle | |
// @match https://www.facebook.com/ | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Play on and on | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Prevent nagging | |
// @author Lavi | |
// @run-at document-start | |
// @match https://www.pandora.com/* | |
// @grant none | |
// ==/UserScript== |
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
/** | |
* Converts object properties to query string. | |
* @param {object} props - The object used to construct the query string. | |
* @return {string} The query string. | |
*/ | |
export default (props) => { | |
return typeof props === 'object' | |
? `?${Object.keys(props).map((prop) => `${prop}=${props[prop]}`).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
{ | |
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json", | |
"basics": { | |
"name": "Lavi Yatziv", | |
"label": "Senior Web Developer", | |
"image": "", | |
"email": "lavi.yatziv@gmail.com", | |
"phone": "", | |
"url": "http://www.fixedspace.com", | |
"summary": "A graduate of Carleton University's Film program as well as Algonquin College's Radio and TV Broadcasting studies, my work is situated at the juncture between digital and more traditional media. My thorough understanding of both allows me to create beautiful yet functional websites, promotional videos and animation. Troubleshooting and improving functionality for existing websites are among my specialties.", |
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
export default (tr) => { | |
const hasLength = (val) => val.length | |
const noTest = () => true | |
const notZero = (val) => val !== 0 | |
const types = { | |
'symbol': (val) => val.description === "", | |
'function': noTest, | |
'undefined': noTest, | |
'bigint': notZero, | |
'object': (val) => Object.is(val, {}), |
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 makePamphlet = (suspectInput) => { | |
const input = Boolean(suspectInput % 2) ? suspectInput + 1 : suspectInput; | |
const evenPages = [ | |
...Array(input / 2) | |
.fill(0) | |
.map((_el, idx) => (idx + 1) * 2), | |
].reverse(); | |
const oddPages = [ | |
...Array(input) | |
.fill(0) |
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
export const addFixed = (a: number, b: number, p = 0) => { | |
const countDecimal = (a: number): number => String(a).split('.')[1].length; | |
const dec = isNaN(p) ? Math.max(countDecimal(a), countDecimal(b)) : p; | |
const t = Number(`1${'0'.repeat(dec)}`); | |
return (a * t + b * t) / t; | |
}; |
OlderNewer