Skip to content

Instantly share code, notes, and snippets.

View joseadrian's full-sized avatar

Joseadrian Ochoa joseadrian

View GitHub Profile
@joseadrian
joseadrian / stylebot.json
Last active August 29, 2015 14:05
Stylebot Styles
{
"imgur.com, imgur": {
"_enabled": true,
"_rules": {
"div.social": {
"display": "none"
}
},
"_social": {
"id": 6666,
@joseadrian
joseadrian / .slate
Last active August 29, 2015 14:05
Slate config
# Some default configuration
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config focusCheckWidthMax 3000
# Window Hint Config
config windowHintsIgnoreHiddenWindows false
# config windowHintsBackgroundColor 0;0;0;0
config windowHintsShowIcons true
@joseadrian
joseadrian / Sublime Text URL Launcher.md
Last active August 29, 2015 14:05 — forked from pitpit/Sublime Text 2 URL Launcher.md
Script to make "Jump to file" of PHP-Console extension work with Sublime Text on OS X

This step by step explains how to create an URI protocol (a scheme) to directly edit a file in Sublime Text from browser (or from the terminal), and mostly from notifications of the PHP-Console extension.

Create the URI launcher for "editor://" URI

Launch AppleScript and export the open_editor.scpt script as an Application (name it "Sublime Text URL Launcher").

imgur

Edit Info.plist

@joseadrian
joseadrian / ci.status_code.json
Created September 6, 2014 07:08
CI - Status Code
{
"200": "OK",
"201": "Created",
"202": "Accepted",
"203": "Non-Authoritative Information",
"204": "No Content",
"205": "Reset Content",
"206": "Partial Content",
"300": "Multiple Choices",
/* Side notes for calling out things
-------------------------------------------------- */
/* Base styles (regardless of theme) */
.bs-callout {
margin: 20px 0;
padding: 15px 30px 15px 15px;
border-left: 5px solid #eee;
@joseadrian
joseadrian / ci.debugger.php
Last active August 29, 2015 14:08
PHP CI Debugger
<?php
if(isset($_GET['sleep']) and !empty($_GET['sleep']))
{
sleep($_GET['sleep']);
}
/* Muestra la memoría usada en Consola */
register_shutdown_function('memory');
@joseadrian
joseadrian / vidcast.js
Created January 11, 2015 23:45
VidCast bookmark
javascript:function iprl5()%7Bvar d%3Ddocument,z%3Dd.createElement(%27scr%27%2B%27ipt%27),b%3Dd.body,l%3Dd.location%3Btry%7Bif(!b)throw(0)%3Bz.setAttribute(%27src%27,%27https://dabble.me/cast/bookmarklet.js%3F%27%2B(new Date().getTime()))%3Bb.appendChild(z)%3B%7Dcatch(e)%7Balert(%27Please wait until the page has loaded.%27)%3B%7D%7Diprl5()%3Bvoid(0)
.directive('numbersOnly', function () {
return {
restrict: 'A',
link: function (scope, elm, attrs, ctrl) {
// record ctrl key being down for ctrl+v and ctrl+c
var ctrlDown = false;
// reset the ctrl key flag on keyup
elm.on('keyup', function (event) {
ctrlDown = false;
});
@joseadrian
joseadrian / frontend-guidelines.md
Created February 27, 2015 18:16
Some HTML, CSS and JS best practices. Source: @bendc/frontend-guidelines

Frontend Guidelines

HTML

Semantics

HTML5 provides us with lots of semantic elements aimed to describe precisely the content. Make sure you benefit from its rich vocabulary.

<!-- bad -->
// This function creates a new anchor element and uses location
// properties (inherent) to get the desired URL data. Some String
// operations are used (to normalize results across browsers).
function parseURL(url) {
var a = document.createElement('a');
a.href = url;
return {
source: url,
protocol: a.protocol.replace(':',''),