Skip to content

Instantly share code, notes, and snippets.

@wwgist
wwgist / gist:3918421
Created October 19, 2012 14:13
HTML: Starting Template
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<script src="https://ajax.google.leapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
@wwgist
wwgist / .bash_profile
Last active October 12, 2015 02:37 — forked from bcardarella/.bash_profile
GIT: Autocompletion (extends .bashrc)
source ~/.git-completion.sh
alias gco='git co'
alias gci='git ci'
alias grb='git rb'
@wwgist
wwgist / bashrc_section.txt
Created February 12, 2013 10:42
BASHRC: GIT aliases
# GIT aliases
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias go='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
@wwgist
wwgist / settings.py
Created February 17, 2013 14:32
DJANGO: settings
# -*- coding: utf-8 -*-
# Django settings for project PROJECT.
import os
# relative project path
rel = lambda *x: os.path.join(os.path.dirname(os.path.abspath(__file__)), *x)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@wwgist
wwgist / .gitconfig
Created February 20, 2013 17:00
GIT: .gitconfig
[user]
name = wowkalucky
email = wowkalucky@gmail.com
[core]
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
editor = nano
[color]
@wwgist
wwgist / list_flattening.py
Created March 7, 2013 07:46
PYTHON: list flattening
flatten_list = [item for sublist in start_list for item in sublist]
@wwgist
wwgist / list_sum.py
Created March 7, 2013 11:00
PYTHON: list sum...
# start_list = [1,2,3,4,5]
result = reduce(lambda a,b: a+b, start_list)
# result = 120
@wwgist
wwgist / list_index-items.py
Created March 7, 2013 11:05
PYTHON: from list > index+item pairs
# list = ['a', 'b', 'c', 'd', 'e']
for index, item in enumerate(list):
print index, item
# печатает "0 a 1 b 2 c 3 d 4 e"
@wwgist
wwgist / list_any_item.py
Created March 7, 2013 11:12
PYTHON: check list items on the ANY condition
# start_list = [1,10,100,1000,10000]
if any(item < 10 for item in start_list):
print 'Success'
@wwgist
wwgist / list_all_items.py
Created March 7, 2013 11:15
PYTHON: check list items on the ALL condition
# start_list = [1,10,100,1000,10000]
if all(item < 10 for item in start_list):
print 'Success'