Skip to content

Instantly share code, notes, and snippets.

View sputnikus's full-sized avatar

Martin Putniorz sputnikus

  • Freelance
  • Brno, Czech Republic
View GitHub Profile
@ghoseb
ghoseb / factorial.py
Created November 14, 2008 18:58
The evolution of a Python Programmer
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
;; this file is a walkthrough of Moustache features, a web framework for Clojure
;; http://github.com/cgrand/moustache/tree/master
;; Moustache allows to declare routes, apply middlewares and dispatch on http methods.
;; Moustache is compatible with all frameworks built on Ring, including Compojure
(ns demo
(:use net.cgrand.moustache)
(:use [ring.adapter.jetty :only [run-jetty]])) ;; hmmm Ring without servlets
@defunkt
defunkt / installing-mustache.vim.md
Created March 6, 2010 10:21
Installing mustache.vim

mustache.vim

In your shell:

cd ~/.vim
git clone git://github.com/juvenn/mustache.vim.git
mv mustache.vim/syntax/* syntax/
mv mustache.vim/indent/* indent/
mv mustache.vim/ftdetect/* ftdetect/

rm -rf mustache.vim

@jsjohnst
jsjohnst / example_output.png
Created May 13, 2011 17:10
Example of getting recommendations from LinkedIn JSAPI
example_output.png
➜ flask-post curl -i -0 -d 'foo=bar' http://flaskpost-miyagawa.dotcloud.com/post
HTTP/1.1 200 OK
Server: nginx/1.0.5
Date: Thu, 01 Sep 2011 02:00:40 GMT
Content-Type: text/html; charset=utf-8
Connection: close
Content-Length: 10
curl: (18) transfer closed with 10 bytes remaining to read
➜ flask-post curl -i -0 -d 'foo=bar' http://flaskpost-miyagawa.dotcloud.com/post_read_data
@starenka
starenka / .gitignore
Created September 18, 2011 20:02
fabfile to deploy flask app to nginx/supervisor/uwsgi stack
.idea/*
*.pyc
@honzajavorek
honzajavorek / gist:1325995
Created October 30, 2011 14:58
Co se dá dělat v Brně a tak vůbec

Co se dá dělat v Brně a tak vůbec :)

Vevnitř

  • hry: deskové hry, karetní hry, šachy, ...
  • divadlo (NDB, méně vážná divadla jako např. Buranteatr, Služebníci lorda Alfréda, ...)
  • kulečník (např. ve 14ce je za zálohu zadarmo, stačí přijít ve všední den jako např. ve čtvrtek)
  • kino (multiplexy, ART, letní kino na Dobráku)
  • sport (např. squash, plavání, ...)
  • tanec (jednorázové kurzy samby, klasické taneční kurzy)
@christophermanning
christophermanning / README.mkd
Last active August 28, 2023 00:46
Hamiltonian Graph Builder
<style type="text/css">p {text-align:center;width: auto}</style>

Created by Christopher Manning

Gallery

Axle Eight Fibbobaci Florets [![Star]

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 18, 2024 22:25
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'