Skip to content

Instantly share code, notes, and snippets.

View djromero's full-sized avatar
⌨️
Working

Julián Romero djromero

⌨️
Working
  • Job&Talent
  • Madrid (Spain)
View GitHub Profile
@djromero
djromero / url-bar-search.js
Created August 1, 2011 11:06
Fake in-URL-bar-search à la Chrome replacing ISP DNS redirect.
/*
* Fake in-URL-bar-search à la Chrome replacing hijacked DNS redirects
*
* /etc/hosts
* 127.0.0.1 dnssearch.jazztel.com # where your DNS redirects
*
* Should run as root to be able to use port 80:
* sudo node url-bar-search.js
*/
var http = require("http");
@djromero
djromero / gist:2180044
Created March 24, 2012 08:23
Clean Antena 3 F1 live streaming page
$("head").remove();
$("#embed_live").appendTo("body");
$("#embed_live").siblings().remove();
@djromero
djromero / gist:2294562
Last active October 2, 2015 18:28
RTVE live sports w/out facebook crap
/* Extract flash video player from rtve.es */
$("head").remove();
$("object").appendTo("body");
$("object").siblings().remove();
@djromero
djromero / .git_bash_profile
Last active December 14, 2015 08:09
git branch on bash prompt and terminal tab/window title bar
get_dir() {
printf "%s" $(pwd | sed "s:$HOME:~:")
}
rename_tab() {
echo -ne "\033]0;"$@"\007"
}
rename_tab_git_branch() {
branch=`git symbolic-ref HEAD 2>/dev/null | cut -d/ -f3`
@djromero
djromero / gist:5348426
Created April 9, 2013 19:03
GenerateDocSet.sh
#!/bin/sh
appledoc=`which appledoc`
TMPDOCS=/Volumes/mem/appledoc-tmp
if [ "x${SRCROOT}" != "x" ];then
ROOT="${SRCROOT}"
else
ROOT=/path/to/project
fi
@djromero
djromero / gist:7326400
Created November 5, 2013 21:12
DJRPasteboardProxy
/* .h */
@interface DJRPasteboardProxy : NSObject
@property NSPasteboard *pasteboard;
@end
/* .m */
@djromero
djromero / gist:7326432
Created November 5, 2013 21:13
DJRKeyboardTools
/* .h */
#import <Foundation/Foundation.h>
#import <Carbon/Carbon.h>
@interface DJRKeyboardTools : NSObject
{
TISInputSourceRef layout;
const UCKeyboardLayout* layoutData;
id keyCodeCache;
@djromero
djromero / gist:7326451
Created November 5, 2013 21:15
DJRKeyboardEvents
/* .h */
@interface DJRKeyboardEvents : NSObject
+ (void)sendCommandC;
@end
/* .m */
# This script adds a "Webclip" shortcut to your homescreen.
# The shortcut can be used to open a web page in full-screen mode,
# or to launch a custom URL (e.g. a third-party app).
# You'll be asked for a title, a URL, and an icon (from your camera roll)
import plistlib
import BaseHTTPServer
import webbrowser
import uuid
from io import BytesIO
@djromero
djromero / gist:8567235
Created January 22, 2014 20:58
Upgrade command-t to avoid crashing in Mavericks
cd ~/.vim/bundle/command-t/ruby/command-t
git pull
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
make