Skip to content

Instantly share code, notes, and snippets.

View matagus's full-sized avatar
🐿️
I miss the old Github activity stream

Matías Agustín Méndez matagus

🐿️
I miss the old Github activity stream
View GitHub Profile
@matagus
matagus / opml.xml
Created March 13, 2014 10:31
planetdjango.org opml file listing all its feeds
<?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 August 29, 2015 14:00
Flashing Firefox OS for Geekphone
  • 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:
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
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"
// 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 August 29, 2015 14:06
vim config using vim-bundle (vundle)
" 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 September 23, 2014 17:46
favorite.js for django-favit with support for dynamic items added at any time
$(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 October 27, 2009 14:21
svn config file
### 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;
@matagus
matagus / trying exaile src code
Created February 10, 2010 20:07
how to get unique artists and albums in exaile 0.3.1 beta
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()