Skip to content

Instantly share code, notes, and snippets.

View joseadrian's full-sized avatar

Joseadrian Ochoa joseadrian

View GitHub Profile
<?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
*
@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"/>
@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 / 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 / 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 / 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 / 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 / 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 / android.java
Last active August 29, 2015 14:02
Open app if installed. If not, open store @source: https://www.waze.com/es-419/about/dev
try
{
String url = "waze://?q=Hawaii";
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( url ) );
startActivity( intent );
}
catch ( ActivityNotFoundException ex )
{
Intent intent =
new Intent( Intent.ACTION_VIEW, Uri.parse( "market://details?id=com.waze" ) );
@joseadrian
joseadrian / clen-player.md
Created July 9, 2014 05:12
Youtube stuff
youtube.com/v/video-id?controls=0&loop=1&rel=0&showinfo=0&version=3