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 8000Each 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| # Easier navigation: .., ..., ...., ....., ~ and - | |
| alias ..="cd .." | |
| alias ...="cd ../.." | |
| alias ....="cd ../../.." | |
| alias .....="cd ../../../.." | |
| alias ~="cd ~" # `cd` is probably faster to type though | |
| alias -- -="cd -" | |
| # Shortcuts | |
| alias d="cd ~/Documents/Dropbox" |
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
| import java.io.FileDescriptor; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import java.io.PrintStream; | |
| public class HelloWorld{ | |
| private static HelloWorld instance; | |
| public static void main(String[] args){ | |
| instantiateHelloWorldMainClassAndRun(); |
| echo '[Unit] | |
| Description=High-performance, schema-free document-oriented database | |
| After=syslog.target network.target | |
| [Service] | |
| User=mongodb | |
| Group=mongodb | |
| ExecStart=/usr/bin/mongod -f /etc/mongod.conf | |
| [Install] |
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| func main() { | |
| fmt.Println("Times: ") | |
| t := time.Now() |
| // Simple function to add a menu option to the spreadsheet "Export", for saving a PDF of the spreadsheet directly to Google Drive. | |
| // The exported file will be named: SheetName and saved in the same folder as the spreadsheet. | |
| // To change the filename, just set pdfName inside generatePdf() to something else. | |
| // Running this, sends the currently open sheet, as a PDF attachment | |
| function onOpen() { | |
| var submenu = [{name:"Save PDF", functionName:"generatePdf"}]; | |
| SpreadsheetApp.getActiveSpreadsheet().addMenu('Export', submenu); | |
| } |
| export ZSH=$HOME/.oh-my-zsh | |
| export DEFAULT_USER='athityakumar' | |
| TERM=xterm-256color | |
| ZSH_THEME="powerlevel9k/powerlevel9k" | |
| POWERLEVEL9K_MODE='awesome-fontconfig' | |
| POWERLEVEL9K_PROMPT_ON_NEWLINE=true | |
| POWERLEVEL9K_PROMPT_ADD_NEWLINE=true | |
| POWERLEVEL9K_RPROMPT_ON_NEWLINE=true | |
| POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 |
My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)