Skip to content

Instantly share code, notes, and snippets.

View juancarlospaco's full-sized avatar
👑
https://t.me/NimArgentina

Juan Carlos juancarlospaco

👑
https://t.me/NimArgentina
View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active January 11, 2025 13:22
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@rondevera
rondevera / css-to-select-range-of-children.html
Last active February 8, 2023 11:29
CSS selector for a range of children
<!DOCTYPE html>
<html>
<head>
<style>
/* How to select a range of children
* (Here, 3rd-7th children, inclusive):
*/
ul li:nth-child(n+3):nth-child(-n+7) {
outline: 1px solid #0f0;
}
@defunkt
defunkt / clients.md
Created April 18, 2010 14:09
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@zed
zed / main.c
Created April 18, 2010 19:32
compare relative performance of tolower_ctype, tolower_openbsd, tolower_oraz functions
// compare relative performance of tolower_ctype, tolower_openbsd, tolower_oraz functions
// result: 30.80, 30.51, 38.09
// $ gcc -std=c99 -O3 -g -Wall -pedantic test_tolower.c -o test_tolower;
// $ valgrind --tool=callgrind ./test_tolower 1000000
#include <assert.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@kennethreitz
kennethreitz / console_progress.py
Created June 23, 2010 21:35
Awesome iterator-based CLI progress bar for Python.
import sys
import time
def progressbar(it, prefix = "", size = 60):
count = len(it)
def _show(_i):
x = int(size*_i/count)
sys.stdout.write("%s[%s>%s] %i/%i\r" % (prefix, "="*x, "-"*(size-x), _i, count))
sys.stdout.flush()
@kennethreitz
kennethreitz / media.py
Created July 15, 2010 21:19
Store binaries smoothly within code (for pre-binded applications)
""" media.py -- Stores any files in python code for binding
By Kenneth Reitz - MIT License
Example Usage:
# initialize mediapool
media.init()
#save a file to mediapool
media.save('test_file')
@kennethreitz
kennethreitz / _tracer.py
Created September 4, 2010 17:17
The greatest trace decorator of all time
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from decorator import decorator #http://pypi.python.org/pypi/decorator
@decorator
def trace(f, *args, **kwargs):
"""Print scope, call, and argument information."""
_scope = inspect.getmodule(f).__name__
@kennethreitz
kennethreitz / gist.py
Created September 9, 2010 00:26 — forked from soeren/gist.py
import httplib
import urllib
import re
import os.path
def gist_write(name, content, ext=None, login=None, token=None):
if ext is None:
ext = os.path.splitext(name)[1]
@kennethreitz
kennethreitz / sync.py
Created October 10, 2010 19:08
GitHub Syncer. Clones or Pulls all GitHub repos (including watched list).
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Kenneth Reitz's GitHub Syncer
This script uses the GitHub API to get a list of all forked, mirrored, public, and
private repos in your GitHub account. If the repo already exists locally, it will
update it via git-pull. Otherwise, it will properly clone the repo.
It will organize your repos into the following directory structure:
import time
class Retry(object):
default_exceptions = (Exception)
def __init__(self, tries, exceptions=None, delay=0):
"""
Decorator for retrying function if exception occurs
tries -- num tries
exceptions -- exceptions to catch