This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void tokenize(const string& instr, Tokens& tokens) | |
{ | |
// trim spaces & not valid chars | |
string str; | |
trim_acс trimmer(str); | |
for_each(instr.begin(), instr.end(), trimmer); | |
string::size_type numPos = str.find_first_of(NUMS, 0); | |
string::size_type endPos = str.find_first_not_of(NUMS, numPos); | |
string::size_type opPos; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
factorial1 n = if n == 0 then 1 else n * factorial1 (n-1) | |
factorial2 0 = 1 | |
factorial2 n = n * factorial2 (n-1) | |
factorial3 n = foldr (*) 1 [1..n] | |
factorial4 = foldr (*) 1 . enumFromTo 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
st = status | |
co = checkout | |
ci = commit | |
br = branch | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%an%Creset' --abbrev-commit --date=relative | |
[color] | |
ui = auto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
from fabric.api import local, settings, abort, run, cd, env, sudo | |
from fabric.colors import green as _green | |
from fabric.colors import yellow as _yellow | |
from fabric.colors import red as _red | |
from fabric.contrib.console import confirm | |
from fabric.contrib.project import rsync_project | |
from fabric.contrib.files import upload_template, exists | |
from fabric.operations import require | |
from fabric.context_managers import prefix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# override settings with environment and local_settings | |
FLAVOR = os.environ.get('FLAVOR') | |
if FLAVOR: | |
override_settings('config.' + FLAVOR) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This fabric file makes setting up and deploying a django application much | |
easier to webfaction servers or your dedicated server, but it does make a | |
few assumptions. Namely that you're using Git, Apache and mod_wsgi. Also | |
you should have SSH installed on both the local machine and any servers you | |
want to deploy to. | |
Thanks to: | |
http://github.com/ryanmark/django-project-templates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
before http://pix.am/ArBv/ | |
after http://pix.am/uvye/ | |
*/ | |
#top-bar { | |
display: none; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The version info for the project you're documenting, acts as replacement for | |
# |version| and |release|, also used in various other places throughout the | |
# built documents. | |
# The short X.Y version. | |
version = get_version().lstrip('v') | |
# The full version, including alpha/beta/rc tags. | |
release = version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat buffer.c | |
#include <stdio.h> | |
#include <string.h> | |
#include <time.h> | |
int main() { | |
char src[4] = {0}; | |
char dst[1] = {0}; | |
time_t epoch; | |
time(&epoch); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arrow | |
import csv | |
import boto3 | |
import datetime | |
import logging | |
import numpy as np | |
import os | |
import re | |
import sys | |
import StringIO |
OlderNewer