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
" @alixedi - My .vimrc based on: | |
" Sample by Martin Brochhaus: github.com/mbrochh/ | |
" Automatic reloading of .vimrc | |
autocmd! bufwritepost .vimrc source % | |
" Better copy & paste | |
" When you want to paste large blocks of code into vim, press F2 before you |
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
Hello World! | |
============ | |
I am **Ali**. |
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 json | |
class Record(object): | |
""" | |
A simple trick that allows you to do `record.name`, 'record.age' | |
instead of `record['name']`, `record['age']`. | |
>>> import json | |
>>> data = json.dumps([{'name': 'jack', 'user': {'id': 21}}]) | |
>>> recs = Record.make_records(data) |
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
def xtemplate(toks, str): | |
''' | |
A function that generates templates from given tokens and | |
strings. We are using this to generate email templates: | |
>>> sep = [(',', ','), ('-', '-'), ('_', '_')] | |
>>> ini = [('$fini', 'a'), ('$lini', 'z')] | |
>>> name = [('$fname', 'ali'), ('$lname', 'zaidi')] | |
>>> toks = sep + ini + name | |
>>> xtemplate(toks, 'ali.zaidi') | |
'$fname.$lname' |
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
#! /usr/bin/env python | |
''' | |
Nutshell - make long CLI commands interactive | |
--------------------------------------------- | |
I am lazy. I am forgetful. I often have to write long CLI commands. | |
The shell history does an awesome job of remembering them for me but too often | |
I end up working too hard in trying to find the line I wrote a couple of days | |
back and having to change something simlple e.g. name of a file etc. |
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
#!/usr/bin/python | |
#By Steve Hanov, 2011. Released to the public domain | |
import time | |
import sys | |
DICTIONARY = "/usr/share/dict/words"; | |
TARGET = sys.argv[1] | |
MAX_COST = int(sys.argv[2]) | |
# read dictionary file |
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
#!/bin/bash | |
# server-jre-8u5-linux-x64.tar.gz | |
DEBIAN_FRONTEND=noninteractive | |
UCF_FORCE_CONFFNEW=true | |
export UCF_FORCE_CONFFNEW DEBIAN_FRONTEND | |
apt-get update | |
apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" dist-upgrade |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer