Skip to content

Instantly share code, notes, and snippets.

View rayfranco's full-sized avatar

Franco Bouly rayfranco

View GitHub Profile
Vue.directive('dom', {
isLiteral: true,
bind: function () {
this.vm.$.dom = this.vm.$.dom || {};
this.vm.$.dom[this.expression] = this.el;
},
unbind: function () {
delete this.vm.$.dom[this.expression];
}
});
this.el = document.getElementById('video');
var minW = 1024;
var minH = 661;
var onResize = function() {
var ch, cr, cw, ph, pr, pw, css;
if (!this.el) {
return;
}
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
@rayfranco
rayfranco / README.md
Created April 7, 2014 23:42
Convert YML to JSON with gulp

Convert YML to JS with gulp

This was a very straightforward workaround I used in a project to get things done while the assemble team is working on some serious converter gulp-convert.

@rayfranco
rayfranco / remove_console_logs.py
Created May 23, 2013 16:54
Sublime Text 2+ to remove `console` lines in javascript/coffeescript files
import sublime, sublime_plugin
class CopyPathCommand(sublime_plugin.TextCommand):
def run(self, edit):
if len(self.view.file_name()) > 0:
sublime.set_clipboard(self.view.file_name())
sublime.status_message("Copied file path")
def is_enabled(self):
return self.view.file_name() and len(self.view.file_name()) > 0
@rayfranco
rayfranco / jquery.countdown.coffee
Created March 28, 2013 09:17
jquery.countdown.coffee : a minimal jquery plugin to launch a countdown with a simple API
$ = jQuery
defaults =
kickoff: "March 28, 2017 18:30:00"
onStart: (kickoff, el) ->
console and console.log "Countdown will start to #{ kickoff }"
onChange: (counter,el) ->
if not el
console.log "Countdown state : #{ counter.days } days, #{ counter.hours } hours, #{ counter.minutes } minutes, #{ counter.seconds } seconds left."
else
@rayfranco
rayfranco / GravatarExtension.php
Last active November 6, 2018 05:30
Twig extension filter that convert email into gravatar url, or secure gravatar url
<?php
// Acme\DemoBundle\Twig\GravatarExtension
namespace Acme\DemoBundle\Twig;
class GravatarExtension extends \Twig_Extension
{
private $secure_request = false;
@rayfranco
rayfranco / LICENSE.txt
Created November 21, 2012 15:29 — forked from atk/LICENSE.txt
polyfill an ES5-compatible Array.prototype.indexOf
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alex Kloss <alexthkloss@web.de>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@rayfranco
rayfranco / APACHE: .htaccess pushstate
Created July 30, 2012 23:04
.htaccess for HTML5 Pushstate support
<ifModule mod_rewrite.c>
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html
</ifModule>
@rayfranco
rayfranco / gist:2028144
Created March 13, 2012 11:04
HTML: HTML5shiv import
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->