Skip to content

Instantly share code, notes, and snippets.

Avatar
🧩
Focusing

agustín méndez matagus

🧩
Focusing
View GitHub Profile
@matagus
matagus / opml.xml
Created Mar 13, 2014
planetdjango.org opml file listing all its feeds
View opml.xml
<?xml version="1.0"?>
<opml version="1.1">
<head>
<title>Planet Django</title>
<dateModified>Sat, 08 Mar 2014 20:57:35 +0000</dateModified>
<ownerName>Adomas Paltanavičius</ownerName>
<ownerEmail>adomas.paltanavicius@gmail.com</ownerEmail>
</head>
<body>
@matagus
matagus / booting-and-flashing.md
Last active Aug 29, 2015
Flashing Firefox OS for Geekphone
View booting-and-flashing.md
  • Download the image you want to flash from http://downloads.geeksphone.com/ according to the geekphone model you have (keon, peak or revolution)
  • unzip .zip
  • cd
  • If you look at the content of the directory you'll see it contains adb and fastboot Android platform tools.
  • Start adb server: sudo ./adb start-server
  • Turn on your phone and enable "Remote Debugging" under Developer settings section.
  • Plug your phone to your computer using your USB wire.
  • Check that your computer is listening to your phone: ./adb devices. You'll see something like this:
View learn.lua
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
View json_log_decode.lua
require "cjson"
-- Generic decoder for JSON logs. This will extract all JSON
-- keys and add them to the `Fields` variable of the created
-- Heka message.
--
-- Example use:
--
-- [NginxJsonLogDecoder]
-- type = "SandboxDecoder"
View utils.js
// using jQuery
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
@matagus
matagus / vimrc
Last active Aug 29, 2015
vim config using vim-bundle (vundle)
View vimrc
" disable vi compatibility
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
Bundle 'gmarik/vundle'
@matagus
matagus / favorite.js
Created Sep 23, 2014
favorite.js for django-favit with support for dynamic items added at any time
View favorite.js
$(document).ready(function() {
$(".endless_container").on("click", ".btn.favorite", function() {
var $obj = $(this);
var target_id = $obj.attr('id').split('_')[1];
$obj.prop('disabled', true);
$.ajax({
url: $obj.attr('href'),
type: 'POST',
data: {target_model: $obj.attr('model'),
target_object_id: target_id},
@matagus
matagus / config
Created Oct 27, 2009
svn config file
View config
### This file configures various client-side behaviors.
###
### The commented-out examples below are intended to demonstrate
### how to use this file.
### Section for authentication and authorization customizations.
[auth]
### Set store-passwords to 'no' to avoid storing passwords in the
### auth/ area of your config directory. It defaults to 'yes'.
### Note that this option only prevents saving of *new* passwords;
View external_links.py
@matagus
matagus / trying exaile src code
Created Feb 10, 2010
how to get unique artists and albums in exaile 0.3.1 beta
View trying exaile src code
In [88]: from xl import collection, xdg
In [89]: c = collection.Collection("Collection", location=os.path.join(xdg.get_data_dirs()[0], 'music.db'))
In [90]: from xl.trax.track import Track
In [91]: albums = set()
In [92]: artists = set()
You can’t perform that action at this time.