Skip to content

Instantly share code, notes, and snippets.

@Garciat
Garciat / imgur_upload.desktop
Created December 28, 2010 17:17
A simple cross-platform CLI Python imgur uploader.
#!/usr/bin/env xdg-open
# Make sure the Python script has +x
[Desktop Entry]
Version=1.0
Name=Imgur Uploader
Exec=/path/to/imgur_upload %U
Terminal=true
Type=Application
@Garciat
Garciat / youtube_subs.py
Created January 27, 2011 17:43
YouTube subscriptions feed parser/simplifier. mod_wsgi version
#! /usr/bin/env python
from time import gmtime, strftime
import urllib2 as urllib
import re
from BeautifulSoup import BeautifulSoup, Tag
###
user = 'gbrlgrct'
@Garciat
Garciat / minify.py
Created July 12, 2011 03:02
Clipboard URL > goo.gl minify > Clipboard. Nice to have as a keyboard shortcut
#!/usr/bin/env python
import platform
import json
import urllib2 as urllib
from urllib import urlencode
# ---
# Copy + Paste functions
@Garciat
Garciat / cinecenter.py
Created November 20, 2012 00:26
Scraper para cinecenter.com.bo
import re
from urllib2 import Request, urlopen
from bs4 import BeautifulSoup as Soup
class Scraper(object):
regions = dict(
lapaz = 'La Paz',
cochabamba = 'Cochabamba',
santacruz = 'Santa Cruz'
)
@Garciat
Garciat / main.cpp
Last active December 14, 2015 02:59
#include "siterator.hpp"
#include "repeater.hpp"
#include "to_bool_arr.hpp"
#include <iostream>
#include <array>
int main() {
using namespace siterator;
using namespace extra;
import tempfile, os, requests, json, webbrowser
import pyscreenshot as pyscr
from base64 import b64encode
# required modules: pyscreenshot, PIL, requests
__client_id__ = '...'
__client_secret__ = '...'
__cred_keys__ = ['access_token', 'refresh_token', 'token_type', 'expires_in']
#include <type_traits>
#include <array>
#include <climits>
#include <iostream>
#include <algorithm>
#include <tuple>
template<size_t... Vals>
struct Sequence { };
function list(v) {
function errchk(f, e) {
try {
return f();
} catch (err) {
if (err instanceof ReferenceError &&
err.message.match(/^[v]+\s/) !== null) {
return e ? e() : undefined;
}
import std.traits, std.stdio;
void times(F)(uint n, F func)
if (isSomeFunction!F)
{
immutable ar = arity!func;
foreach (uint i; 0 .. n) {
static if (ar == 0) {
func();
#include <iostream>
#include <tuple>
#include <string>
#include <typeinfo>
#include <memory>
#include <cxxabi.h>
namespace extra {
template <typename... Types>
struct TypeInfoExtractor;