Skip to content

Instantly share code, notes, and snippets.

View ianaya89's full-sized avatar
👾

Nacho Anaya ianaya89

👾
View GitHub Profile
@ianaya89
ianaya89 / twitter-cards.html
Created April 14, 2015 17:50
Twitter Card API
<!-- Generic Meta Tags -->
<meta name="twitter:card" content="Summary">
<meta name="twitter:url" content="http://your-url.com">
<meta name="twitter:title" content="Some Title">
<meta name="twitter:description" content="Some description.">
<meta name="twitter:image" content="image.png">
<meta name="twitter:site" content="@userName">
<meta name="twitter:creator" content="@userName">
@ianaya89
ianaya89 / browser-hacks.css
Created April 14, 2015 18:49
Browser CSS Hacks by @paul_irish
/***** Selector Hacks ******/
/* IE6 and below */
* html #uno { color: red }
/* IE7 */
*:first-child+html #dos { color: red }
/* IE7, FF, Saf, Opera */
html>body #tres { color: red }
@ianaya89
ianaya89 / cf.css
Created April 14, 2015 19:47
New micro clearfix hack by @necolas
/**
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
.cf:before,
@ianaya89
ianaya89 / script.js
Created June 18, 2015 20:07
Log messages in console with custom styles.
console.log("%c%s",
"color: red; background: yellow; font-size: 24px;",
"WARNING!");
@ianaya89
ianaya89 / screen-grabs.sh
Created July 9, 2015 03:25
Commands to create video screen grabs with ffmpeg
# First Frame
ffmpeg -i myvideo.webm -ss 00:00:01 -vframes 1 first-frame.png
# Frames at Second Intervals
ffmpeg -i myvideo.webm -vf fps=fps=1 screen-%d.png
# Frames at Minute Intervals
ffmpeg -i myvideo.webm -vf fps=fps=1/60 screen-%03d.jpg
@ianaya89
ianaya89 / index.html
Created July 13, 2015 14:55
Get HTML5 Camera and Video on iOS/Android
<!-- HTML5 Camera -->
<input type="file" accept="image/*">
<!-- HTML5 Video -->
<input type="file" accept="video/*;capture=camcorder">
@ianaya89
ianaya89 / autofill.html
Created July 13, 2015 23:28
Chrome autofill properties
<!-- Credit Card -->
<label for="frmNameCC">Name on card</label>
<input name="ccname" id="frmNameCC" required placeholder="Full Name" autocomplete="cc-name">
<label for="frmCCNum">Card Number</label>
<input name="cardnumber" id="frmCCNum" required autocomplete="cc-number">
<label for="frmCCCVC">CVC</label>
<input name="cvc" id="frmCCCVC" required autocomplete="cc-csc">
<label for="frmCCExp">Expiry</label>
<input name="cc-exp" id="frmCCExp" required placeholder="MM-YYYY" autocomplete="cc-exp">
@ianaya89
ianaya89 / pre-commit
Created September 5, 2015 05:17
Git pre-commit hook for JS Lint
#!/usr/bin/env python
import os, sys
"""
Checks your git commit with JSHint. Only checks staged files
"""
def jshint():
errors = []
@ianaya89
ianaya89 / pre-push
Created September 5, 2015 15:44
Git to prevent accidentals push to master
#!/bin/bash
protected_branch='master'
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [ $protected_branch = $current_branch ]
then
read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty
echo
if echo $REPLY | grep -E '^[Yy]$' > /dev/null
@ianaya89
ianaya89 / gulpfile.js
Last active September 11, 2015 14:22
Gulp file with all basic task that you need for web development
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-minify-css gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache gulp-connect del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),