Skip to content

Instantly share code, notes, and snippets.

View ayozebarrera's full-sized avatar
⚛️
Reacting

Ayoze Barrera ayozebarrera

⚛️
Reacting
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>One Graph</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<script type="text/javascript" src="simple-graph.js"></script>
<style type="text/css">
body { font: 13px sans-serif; }
rect { fill: #fff; }
@ayozebarrera
ayozebarrera / gist:23989fefa85216359eaf
Last active August 29, 2015 14:07 — forked from lucasfais/gist:1207002
Sublime Text 2 Useful Shortcuts (Mac OS X)

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@ayozebarrera
ayozebarrera / ratio.css
Created October 22, 2014 09:50
How maintain 16:9 aspect ratio
.ratio{
display: block;
height: 0; /* we have padding-bottom instead height (content+padding-bottom)*/
padding-bottom: 56.25%; /*16:9 ratio -> (9 ÷ 16) × 100 = 56.25 */
overflow: hidden;
}
@ayozebarrera
ayozebarrera / shadow.css
Created December 2, 2014 11:37
shadow effects
/* Differents levels */
color: hsl(330, 100%, 50%);
text-shadow: 0 2px 0 0px hsl(330, 100%, 25%),
0 3px 2px 0px hsla(330, 100%, 15%, 0.5),
/* next */
@ayozebarrera
ayozebarrera / font-face.scss
Created December 7, 2014 20:07
true font-face
// @use: @include font-face('Roboto', '../fonts/Roboto/Roboto-Regular', 400, 'serif');
@mixin font-face($font-family, $file-path, $font-weight, $font-style) {
@font-face {
font-family: $font-family;
src: url('#{$file-path}.eot');
src: url('#{$file-path}.eot?#iefix') format('embedded-opentype'),
url('#{$file-path}.woff') format('woff'),
url('#{$file-path}.ttf') format('truetype'),
url('#{$file-path}.svg##{$font-family}') format('svg');
@ayozebarrera
ayozebarrera / polygon.geojson
Created December 12, 2014 11:00
polygon.geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ayozebarrera
ayozebarrera / index.html
Created January 31, 2015 20:17
ripple effect
<button class="blup active"></button>
@ayozebarrera
ayozebarrera / promise.js
Created February 18, 2015 10:33
json call with promises
if (window.Promise) {
console.log('Promise found');
var promise = new Promise(function(resolve, reject) {
var request = new XMLHttpRequest();
request.open('GET', 'http://api.icndb.com/jokes/random');
request.onload = function() {
if (request.status == 200) {
resolve(request.response); // we got data here, so resolve the Promise
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ayozebarrera
ayozebarrera / make-repo.sh
Last active August 29, 2015 14:15
Make a repository on github from command line
###############################################################################
# CREAR UN REPOSITORIO EN GITHUB DESDE LA TERMINAL ############################
###############################################################################
###############################################################################
# Crear el repositorio en Github (Github API v3)
curl -u '<user>' https://api.github.com/user/repos -d '{ "name": "<repository>" }'
# Añadir el repositorio remoto de Github a nuestro repositorio local
git remote add origin [email protected]:<user>/<repository>.git
# Añadimos todos los cambios