This file contains 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 easygui | |
import PIL | |
# A simple message box | |
easygui.msgbox("Ben is cool", "Warning") | |
# A box with choices |
This file contains 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 uses the grains module | |
# http://docs.saltstack.org/en/latest/ref/modules/all/salt.modules.grains.html#module-salt.modules.grains | |
# http://salt.readthedocs.org/en/latest/ref/states/all/salt.states.module.html#module-salt.states.module | |
salt: | |
module.run: | |
- name: grains.ls | |
This file contains 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
set number | |
set ruler | |
set background=dark | |
set tabstop=2 | |
set shiftwidth=2 | |
" set paste | |
set colorcolumn=80 | |
syntax on | |
filetype plugin on |
This file contains 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
"""Usage: | |
adder.py <value1> <value2> | |
""" | |
from docopt import docopt | |
arguments = docopt(__doc__, version='0.1.1rc') | |
def adder(): | |
number1 = int(arguments['<value1>']) |
This file contains 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
<?php | |
drupal_add_js('jQuery(document).ready(function () { console.log("Hello!"); });', 'inline'); | |
?> |
This file contains 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
Host GitServer | |
Hostname=git.example.org | |
IdentityFile=~/.ssh/my_cool_key_rsa |
This file contains 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
<?php | |
function makedivarrays() { | |
$output = array(); | |
$topdiv = '<div id="topdiv"><div class="myclass">Topdivtext</div></div>'; | |
$bottomdiv = '<div id="bottomdiv"><div class="myclass">bottomdivtext</div></div>'; | |
$output = array( | |
'topdiv' => $topdiv, | |
'bottomdiv' => $bottomdiv, | |
); |
This file contains 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
# Put a real ip address no 12.34.56.78 | |
sudo fail2ban-client get ssh actionunban 12.34.56.78 |
This file contains 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
''' | |
place the bottle.py in the same directory as your hello.py | |
''' | |
from bottle import route, run | |
@route('/') | |
def index(name=['hello', 'World', 'from <a href="http://appfog.com">Appfog!</a>']): | |
return '<br>'.join(name) |
This file contains 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 os | |
from bottle import Bottle, route, run | |
application = app = Bottle() | |
@app.route('/') | |
def index(name=['hello', 'World', 'from <a href="http://appfog.com">Appfog!</a>']): | |
return '<br>'.join(name) | |