Skip to content

Instantly share code, notes, and snippets.

Avatar

Ignacio Rivas sabarasaba

View GitHub Profile
View gist:67188900a783c72d51ab
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" TODO: this may not be in the correct place. It is intended to allow overriding <Leader>.
" source ~/.vimrc.before if it exists.
if filereadable(expand("~/.vimrc.before"))
source ~/.vimrc.before
endif
View gist:9b91ef2a843974288734
Select quotes, brackets ->
ctrl + shfit + space
Switch between tabs ->
ctrl + <1..2..3..?>
Move current tab to panel:
ctrl + shift + <1..2..3..?>
@sabarasaba
sabarasaba / index.html
Created Jun 6, 2014
A Pen by Ignacio Rivas.
View index.html
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<!-- NAVBAR
================================================== -->
<body>
View designer.html
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../core-icons/core-icons.html">
View a.json
{
"request" : {
"country" : "uk",
"language" : "en",
"listing_type" : "buy",
"location" : "soho",
"num_res" : "20",
"offset" : 0,
"output" : "json_xs",
"page" : 1,
View movies.json
{
"status": "ok",
"status_message": "Query was successful",
"data": {
"movie_count": 3749,
"limit": 20,
"page_number": 1,
"movies": [
{
"id": 3753,
@sabarasaba
sabarasaba / gist:1361520
Created Nov 13, 2011
Delete duplicates from a mysql table.
View gist:1361520
DELETE FROM someTable
USING someTable, someTable as virtualTable
WHERE (NOT someTable.id = virtualTable.id)
AND (someTable.name = virtualTable.name)
@sabarasaba
sabarasaba / gist:1362220
Created Nov 13, 2011
Get first url video that matches with the given text
View gist:1362220
<?php
function getYoutubeLink($title)
{
@$videoName = ereg_replace('[[:space:]]+', ' ', trim($videoName));
$videoName = urlencode($videoName);
// generate feed URL
$feedURL = "http://gdata.youtube.com/feeds/api/videos?vq={$videoName}";
@sabarasaba
sabarasaba / gist:3975451
Created Oct 29, 2012
Get the current State of the user.
View index.js
var o = '{ "user": "tu vieja", "posts": [ { "title": "title 1", "contents": "..." }, { "title": "title 2", "contents": "..." } ] }';
var fetchShit = function() {
var def = $.Deferred();
setTimeout(function() {
def.resolve(o);
}, 2000);
return def.promise();