Skip to content

Instantly share code, notes, and snippets.

View mariocesar's full-sized avatar

Mario-César mariocesar

View GitHub Profile
@Cifro
Cifro / gmail-scrollbars.css
Created December 29, 2011 17:23
New Gmail scrollbars for webkit browsers
/*
http://www.webkit.org/blog/363/styling-scrollbars/
*/
.zF.e-Rb::-webkit-scrollbar {
width: 12px
}
.zF.e-Rb::-webkit-scrollbar-thumb {
@jrossi
jrossi / txredns.py
Created January 19, 2012 04:51 — forked from fcoury/txredns.py
Python/Twisted/Redis backed DNS server.
# Python/Twisted/Redis backed DNS server - resolves from NAME to IP addrs
# fallback to google or any other DNS server to resolv domains not present on Redis
# to set a new domain on redis, just issue a SET domain.tld ip_addr
# run with twistd -ny txredns.tac
# gleicon 2011
from twisted.names import dns, server, client, cache
from twisted.application import service, internet
from twisted.internet import defer
from twisted.python import log
@StanAngeloff
StanAngeloff / simple-imagediff.py
Created February 1, 2012 11:45
Simple Image Diff for Git
#!/usr/bin/env python
# Simple Image Diffs
# ==================
#
# How to Install
# --------------
#
# Download the script somewhere on $PATH as 'simple-imagediff' with +x:
#
@sergejx
sergejx / gist:2358089
Created April 11, 2012 08:59
Set dark theme for GTK+ application
from gi.repository import Gtk
settings = Gtk.Settings.get_default()
settings.set_property("gtk-application-prefer-dark-theme", True)
@relekang
relekang / util.py
Created May 28, 2012 21:13
Expire @cache_page in django
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.http import HttpRequest
from django.utils.cache import get_cache_key
def expire_page_cache(view, args=None):
"""
Removes cache created by cache_page functionality.
Parameters are used as they are in reverse()
"""
@vkolev
vkolev / app.py
Created September 17, 2012 17:50
gi.repository Granite with Python
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
#
# app.py
#
# Copyright 2012 Vladimir Kolev <vladi@elementos>
#
# This is a semple application using the Granite widgets
# from the ElementaryOS project
#
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@kipanshi
kipanshi / gist:4007717
Created November 3, 2012 15:53
Django float format and intcomma optimization
import cProfile
from django.template.defaultfilters import floatformat as floatformat_django
from django.contrib.humanize.templatetags.humanize import intcomma as intcomma_django
num = 100000
float_num = 1 / 3.0
def floatformat(value, places=2):
@zodman
zodman / granitedemo.py
Created November 14, 2012 00:25
granite-demo in python
import sys
from gi.repository import Gtk, Gdk, GdkPixbuf
from gi.repository import Granite
class DemoApp(Granite.Application):
application_id="demo.granite.org"
program_name="Granite Demo"
app_years= "2012"
build_version="1.0"
main_url = "https://launchpad.net/granite";
@jhubert
jhubert / colors.sh
Created February 24, 2013 17:53
Generates a table of the `tput setaf` and `tput setab` colors in bash. Based on Daniel Crisman's script from the Bash Prompt HOWTO on Colours: http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
#!/bin/bash
T='gYw' # The test text
for FGs in 0 1 2 3 4 5 6 7;
do FG=${FGs// /}
echo -en " $FGs $(tput setaf $FG) $T "
for BG in 0 1 2 3 4 5 6 7;
do echo -en "$EINS $(tput setaf $FG)$(tput setab $BG) $T $(tput sgr0)";
done