by Celia Green
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
# http.py | |
# usage: python -m http port | |
# e.g.: python -m http 8080 | |
import sys | |
from random import randint | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
from SocketServer import TCPServer |
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
# return the first non repeated character in a string | |
def find_original(string): | |
count_dict = {} | |
order = [] | |
for char in string: | |
if char in count_dict: | |
count_dict[char] += 1 | |
else: | |
count_dict[char] = 1 |
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
from cStringIO import StringIO | |
import Image | |
import logging | |
import math | |
import numpy as np | |
import geoalchemy.functions as functions | |
from geoalchemy import WKTSpatialElement | |
from project.lib.models import Listing |
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
$(document).ready(function(){ | |
$('#primary-nav li').on('click', function(event) { | |
event.preventDefault(); | |
var topic = $(this).attr('class').split(' ')[0]; | |
doNavigationEffect(topic); | |
}); | |
function doNavigationEffect(theTopic) { | |
// switching the active tab |
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
String.prototype.format = function(args) { | |
var paramsRegex = /\(([A-Za-z_0-9:.,\'\"]*)\)/; | |
var replaceRegex = /{([A-Za-z_0-9:.,\'\"\(\)]+)}/g; | |
var string = this; | |
return string.replace(replaceRegex, function(match, key) { | |
if(/:/.test(key)) { | |
var filters = key.split(':'); | |
var value = args[filters.shift()]; | |
for(var i = 0; i < filters.length; i++) { | |
var filterName = filters[i]; |
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
GAmail = function(options, data) { | |
this.options = options; | |
this.data = data; | |
this.currentUser = randomElement(data.friends); | |
this.labels = [{ | |
id: 'inbox', | |
displayName: 'Inbox', | |
}, { | |
id: 'important', | |
displayName: 'High Priority', |
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
<!DOCTYPE html> | |
<html ng-app="carousel"> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.js"></script> | |
<script type="text/javascript"> | |
(function() { | |
var carousel = angular.module("carousel", []); | |
carousel.controller("CarouselController", ["$scope", "$interval", function($scope, $interval) { | |
$scope.images = [ |
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
#menubar { | |
position: absolute; | |
top: 300px; | |
left: 300px; | |
width: 500px; | |
background: #aaa; | |
} | |
.menu { | |
margin: 0; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<div class="icon-box left-icon width-2"> | |
<div class="icon"> | |
<img src="http://placehold.it/48x48"> |
OlderNewer