Skip to content

Instantly share code, notes, and snippets.

View mondeja's full-sized avatar

Álvaro Mondéjar Rubio mondeja

View GitHub Profile
@christophermanning
christophermanning / README.md
Last active November 22, 2022 22:14
Bitbucket Download Directory

Python script to download/shallow clone the files of a directory at bitbucket. This is useful when you just want a copy of the files in a subdirectory of a repository without needing mercurial or having to download the entire repository.

@dupuy
dupuy / README.rst
Last active June 25, 2024 15:05
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@btoone
btoone / curl.md
Last active June 29, 2024 16:01
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@mattetti
mattetti / gist:3798173
Last active April 16, 2023 03:09
async fetching of urls using goroutines and channels
package main
import (
"fmt"
"net/http"
"time"
)
var urls = []string{
"https://splice.com/",
@rburhum
rburhum / urls.py
Created January 17, 2013 20:15
Add tilestache to Django
...
url(r'^v1/tiles/(?P<tile_user>([^/]+))/(?P<tile_layer>([^/]+))/(?P<tile_zoom>(\d+))/(?P<tile_column>(\d+))/(?P<tile_row>(\d+))\.(?P<tile_format>([a-z]+))$', TileManager.as_view(), name='tile_manager'),
...
@lambdamusic
lambdamusic / Snipplr-56709.py
Created February 7, 2013 21:28
Python: RGB Color Gradation Function
import string
def make_color_tuple( color ):
"""
turn something like "#000000" into 0,0,0
or "#FFFFFF into "255,255,255"
"""
R = color[1:3]
G = color[3:5]
B = color[5:7]
@trevorturk
trevorturk / gists.rb
Created February 14, 2013 18:48
Delete all private gists
# gem install httparty
# ruby gists.rb
require 'httparty'
class Gists
include HTTParty
@username = 'x'
@password = 'x'
@clemensg
clemensg / curl_multi_test.c
Last active June 28, 2023 06:51
libcurl multi interface example
/* curl_multi_test.c
Clemens Gruber, 2013
<clemens.gruber@pqgruber.com>
Code description:
Requests 4 Web pages via the CURL multi interface
and checks if the HTTP status code is 200.
Update: Fixed! The check for !numfds was the problem.
@hemanth
hemanth / async.py
Created June 14, 2013 03:03
Async subprocess execution in python.
import sys
from subprocess import PIPE, Popen
from threading import Thread
try:
from Queue import Queue, Empty
except ImportError:
from queue import Queue, Empty # python 3.x
ON_POSIX = 'posix' in sys.builtin_module_names
@KasperBrandt
KasperBrandt / IATI: DBPedia
Created July 29, 2013 19:16
SPARQL query for retrieving all DBPedia countries and their owl:sameAs relations from the DBPedia endpoint: http://dbpedia.org/sparql
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT ?country ?same
WHERE {
?country rdf:type dbpedia-owl:Country .
?country owl:sameAs ?same .
}