Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| bin_PROGRAMS = uberapp | |
| uberapp_SOURCES = main.c |
| #include <stdio.h> | |
| int main (void) | |
| { | |
| puts ("Hello from Uber software."); | |
| return 0; | |
| } |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| ;; download web-mode.el from http://web-mode.org/ and save it to ~/.emacs.d/custom-mode | |
| ;; (You may need to create that directory) | |
| ;; Add these following lines to ~/.emacs | |
| (add-to-list 'load-path "~/.emacs.d/custom-mode") | |
| (require 'web-mode) | |
| (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) |
| Run git rm --cached <submodule name> | |
| Delete the relevant lines from the .gitmodules file. | |
| Delete the relevant section from .git/config. | |
| Commit | |
| Delete the now untracked submodule files. | |
| Remove directory .git/modules/<submodule name> | |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import nltk | |
| from nltk.corpus import wordnet as wn | |
| DOG = wn.synsets("dog")[0] | |
| print(DOG) |
| from random import shuffle, randint | |
| import re | |
| from sets import Set | |
| def f1(seq): # Raymond Hettinger | |
| # not order preserving | |
| set = {} | |
| map(set.__setitem__, seq, []) | |
| return set.keys() |
| import sys | |
| class Player: | |
| def __init__(self, name, age): | |
| self.lives = 10 | |
| self.name = name | |
| self.age = age | |
| def eat(self, food): | |
| if food == "apple": |
| class BankAccount: | |
| def __init__(self, initial_balance=0): | |
| self.balance = initial_balance | |
| def deposit(self,amount): | |
| self.balance += amount | |
| print("Depositted %s" % (amount,)) | |
| def withdraw(self, amount): |
| # Solution 1 | |
| if foo: | |
| moo = 'foo' | |
| elif boo: | |
| moo = 'boo' | |
| elif bar: | |
| moo = 'bar' | |
| else: | |
| moo = 'blah' |