Skip to content

Instantly share code, notes, and snippets.

View cega's full-sized avatar

Carlos GALINDEZ cega

  • Córdoba, CORDOBA, ARGENTINA
View GitHub Profile
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys
@cega
cega / mm2oo.py
Created December 6, 2015 12:42 — forked from mattbowen/mm2oo.py
Mindmeister to OPML: Convert the JSON file in mindmeister's native format into OPML to open with OmniOutliner
"""
Mindmeister to OPML
Convert the JSON file embedded in mindmeister's native format
to OPML 1.0 that can be opened by OmniOutliner. For use with
python 2.6 and above. For usage, run python mm2oo.py --help
Copyright (c) 2011 Matt Bowen (https://github.com/mattbowen)
Permission is hereby granted, free of charge, to any person obtaining a copy of
@cega
cega / pdf.py
Created January 21, 2016 14:20 — forked from grantmcconnaughey/pdf.py
Outputting PDFs with Django 1.8 and FDFgen
# -*- coding: utf-8 -*-
import codecs
import subprocess
from fdfgen import forge_fdf
from django.core.exceptions import ImproperlyConfigured
from django.template import engines
from django.template.backends.base import BaseEngine
from django.template.engine import Engine, _dirs_undefined
@cega
cega / pdf.py
Created May 18, 2016 12:52 — forked from zyegfryed/pdf.py
Outputting PDFs with Django and FDFgen
# -*- coding: utf-8 -*-
import codecs
import subprocess
from fdfgen import forge_fdf
from django.template import Template, loader
from django.template.loader import find_template, LoaderOrigin
class PdfTemplateError(Exception):
@cega
cega / h264-vivaldi-linux.md
Created September 9, 2016 11:20 — forked from ruario/h264-vivaldi-linux.md
Using H.264 in Vivaldi for Linux

How to use H.264, MP3 and AAC support ln Vivaldi for Linux, via an alternative FFMpeg library

Intro

The following is a quick guide to get this working on various Linux distros. As a side note, if you have Chrome installed alongside Vivaldi, Netflix should also work after making these changes.

Ubuntu

The following are steps for Vivaldi beta. If you are running the latest Vivaldi snapshot, please refer to the Vivaldi snapshot section under "Other distros".

@cega
cega / gist:57d69ee38c006439a47c8ad84be380bf
Created October 2, 2016 11:04 — forked from nicwolff/gist:3669759
Bookmarklet to store and fill in a test form
javascript:V=JSON.parse(localStorage['formData']||'{}');M={};F=document.forms;for(i=0;i%3CF.length;i++){E=F[i].elements;for(j=0;j%3CE.length;j++){C=E[j];CT=C.type;if(!C.name||CT=='submit'||CT=='hidden')continue;CN=C.name+':'+(M[C.name]=(M[C.name]||0)+1);CR=CT=='checkbox'||CT=='radio';if(CR&&V[CN]==true)C.checked=true;if(V[CN]&&!CR&&!C.value&&!C.selectedIndex){if(CT=='select-one'){for(k=0;k%3CC.options.length;k++){if(C.options[k].value==V[CN]){C.selectedIndex=k}}}else{C.value=V[CN]}}if(C.value=='-')C.value='';V[CN]=(C.options&&C.selectedIndex%3E-1&&C.options[C.selectedIndex].value)||(CR?C.checked:C.value);}}void(localStorage['formData']=JSON.stringify(V));
@cega
cega / latest-widevine.sh
Created October 12, 2016 20:19 — forked from ruario/intro-latest-widevine.md
Fetches Chrome and extracts out Widevine so that it can be used by Vivaldi. Also works with other Chromium-based browsers, see guide below.
#!/usr/bin/env bash
available () {
command -v $1 >/dev/null 2>&1
}
# Make sure we have wget or curl
if available wget; then
SILENT_DL="wget -qO-"
LOUD_DL="wget"
@cega
cega / radios_nacionales.txt
Created October 17, 2016 12:35 — forked from lifofernandez/radios_nacionales.txt
URLs de radios nacionales de Argentina, para poder escuchar en la terminal con mplayer o vlc
# alias radio='function __radio(){ r=`grep -v "#" radios_nacionales.txt | grep -i $1 | cut -d" " -f1`; cvlc $r; }; __radio'
# podria utilizarse mplayer en vez de vlc
AMs Nacionales
http://200.68.81.65:8000/am530 Radio Madre 530
http://wmserver3.aginet.com.ar:19043 Radio Colonia 550
http://195.154.182.222:26016/;stream/1 Radio Argentina 570
http://7359.live.streamtheworld.com/CONTINENTAL.mp3 Continental 590
http://190.104.220.205:8234 Rivadavia 630
@cega
cega / forms.py
Created October 13, 2017 13:34 — forked from neara/forms.py
Django Class Based Views and Inline Formset Example
from django.forms import ModelForm
from django.forms.models import inlineformset_factory
from models import Sponsor, Sponsorship
class SponsorForm(ModelForm):
class Meta:
model = Sponsor