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
<script> | |
menu = document.getElementById('menu_element'); | |
for (i = 0; i < menu.length; i++) { | |
if (menu.options[i].value == '{{value_to_select}}') { | |
menu.selectedIndex = i; | |
break; | |
} | |
} | |
</script> |
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
<html> | |
<!-- Requires - jquery and jquery-ui --> | |
<link type="text/css" href="static/css/smoothness/jquery-ui-1.8.20.custom.css" rel="stylesheet" /> | |
<script type="text/javascript" src="static/js/jquery-1.7.2.min.js"></script> | |
<script type="text/javascript" src="static/js/jquery-ui-1.8.20.custom.min.js"></script> | |
<div id="fb-root"></div> | |
<script src="http://connect.facebook.net/en_US/all.js"></script> | |
<script> | |
FB.init({ |
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
def bulk_invite(self, user_ids, group_id, invite_message): | |
self.db['user_details'].update( { '_id' : { '$in' : user_ids } }, | |
{ '$set' : { 'group_invites.' + str(group_id) : invite_message} }, multi=True, safe=True) |
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
""" looks for the string: '@user ' in the string message and removes all occurrences""" | |
def remove_user_from_message(msg, user): | |
p = re.compile('@'+user+'\s+') | |
return p.subn('', msg)[0] | |
""" | |
indexOf and substring are done like this: | |
index_of = find |
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 time | |
import re | |
def load(): | |
file_to_open = open('data.txt', "r") | |
return file_to_open.read() | |
def print_me(s): | |
print s |
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
$('#message').focus().val($("#message").val()); |
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
<!-- How 2 make a HTML div float at the bottom of the page: --> | |
<div id="container" style='position:relative;'> | |
<!-- Other elements here --> | |
<div id="copyright" style='position:absolute; bottom:0;'> | |
Copyright Foo web designs | |
</div> | |
</div> |
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
# colors | |
export CLICOLOR=1 | |
export TERM=xterm-color | |
export LSCOLORS=gxgxcxdxbxegedabagacad # cyan directories | |
# We use UK keyboard | |
setxkbmap -layout gb | |
set completion-prefix-display-length 2 | |
set completion-ignore-case 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
# colors | |
export CLICOLOR=1 | |
export TERM=xterm-color | |
export LSCOLORS=gxgxcxdxbxegedabagacad # cyan directories | |
# old Prompt | |
#export PS1='\[\033[01;32m\]\u@:\[\033[01;36m\]\w\[\033[00m\]\$ ' | |
#Android sdk add to PATH | |
#PATH=$PATH:/System/Library/android-sdk-mac_x86/tools/ |