Skip to content

Instantly share code, notes, and snippets.

View joseadrian's full-sized avatar

Joseadrian Ochoa joseadrian

View GitHub Profile
@joseadrian
joseadrian / css.attributes.md
Last active August 29, 2015 14:02
CSS Hacks / Cross-browsing / Repaso

Attribute Hacks

IE6

#once { _color: blue }

IE6, IE7

#doce { *color: blue; /* or #color: blue */ }
@joseadrian
joseadrian / regex.md
Created June 11, 2014 14:05
Expresiones reguales

Buscar comentarios multi-línea

/^[(/*)+.+(*/)]$/

Colores hexadecimales

/^#(?:(?:[a-f\d]{3}){1,2})$/i
@joseadrian
joseadrian / example.js
Last active October 25, 2022 10:41
Quintus - Box component
Q.Sprite.extend("Square",{
init: function(p) {
this._super(p,{
// ...
});
this.add('box');
this.on('boundaries');
},
boundaries: function(side) {
@joseadrian
joseadrian / dummyFiles.md
Created February 21, 2014 05:11
Create dummy files Windows / Linux / OS X

Windows

fsutil file createnew ./test.tmp 1048576

Linux

dd if=/dev/zero of=test.tmp bs=1M count=1

OS X & Solaris

@joseadrian
joseadrian / hideFiles.sh
Created February 5, 2014 17:27
Hide/Show files on Finder OSX
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
@joseadrian
joseadrian / lstofile.sh
Created January 28, 2014 03:11
List files into a file text

The -R flag drills recursively into sub folders.

The -F flag writes a trailing slash '/' after folders, and a trailing asterisk '*' after executable files.

Source

@joseadrian
joseadrian / canvas_url.php
Last active December 31, 2015 15:49
Facebook Comments
<!--
This file is the Canvas URL
It's generated automatically
-->
<head>
<meta charset="UTF-8" />
<title>Title</title>
<meta property="fb:app_id" content="474221426024929" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Title"/>
<?php
// https://github.com/GerHobbelt/nicejson-php/blob/master/nicejson.php
// original code: http://www.daveperrett.com/articles/2008/03/11/format-json-with-php/
// adapted to allow native functionality in php version >= 5.4.0
/**
* Format a flat JSON string to make it more human-readable
*
#banner {
border: 1px solid #666;
display: block;
width: 100%;
height: 1em;
font-size: 1em;
line-height: 1em;
margin: 20px auto;
padding: 0px;
text-align: justify;
@joseadrian
joseadrian / first-example.js
Last active December 29, 2015 15:59
jQuery Lines examples
$('.first').lines({
replace: function(lines) {
var lastLine = lines[lines.length-1];
var center = $(this).width()/2 - lastLine.width/2;
lines[lines.length-1].text = '<span style="position:relative;margin-left:'+center+'px">'+lastLine.text+'</span>';
return lines;
}
});