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 pymongo import MongoClient | |
import datetime | |
import bunch | |
from faker import Faker | |
from random import choice | |
client = MongoClient(host="localhost", port=27017) | |
faker = Faker() | |
posters = [] |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.16470588743686676</real> | |
<key>Green Component</key> | |
<real>0.20784313976764679</real> |
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 sys | |
import os | |
from random import choice | |
if len(sys.argv) < 2: | |
print 'Usage: python {} /absolute/path/to/article/directory'.format(os.path.basename(__file__)) | |
exit() | |
content = """title: Pokedex for {} | |
summary: 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
https://chart.googleapis.com/chart?cht=bvs&chs=750x50&chd=t:0,0,0,0,0,10,50,60,80,40&chco=EBF2FF&chbh=25,1&chm=r,FFFFFF,0,-0.01,0.01,1|R,FFFFFF,0,-0.01,0.01,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
# -*- coding: utf-8 -*- | |
from functools import wraps | |
import redis | |
from flask import Flask, request | |
from datetime import datetime | |
app = Flask(__name__) | |
# -*- coding: utf-8 -*- |
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
#!/usr/bin/env python | |
""" | |
urlnorm.py - URL normalisation routines | |
urlnorm normalises a URL by; | |
* lowercasing the scheme and hostname | |
* taking out default port if present (e.g., http://www.foo.com:80/) | |
* collapsing the path (./, ../, etc) | |
* removing the last character in the hostname if it is '.' |
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
$.fn.getPureRotation = function(element) { | |
var degrees = null; | |
$.each(['-webkit-transform', '-moz-transform', '-o-transform', '-sand-transform', '-ms-transform', 'transform'], function(index, value) { | |
var matrix = $(element).css(value); | |
if(degrees == null || Boolean(matrix)) { | |
var arrMatrix = matrix.match(/[\-0-9.]+/g); | |
if( | |
(parseFloat(arrMatrix[1]) == (-1 * parseFloat(arrMatrix[2]))) || | |
(parseFloat(arrMatrix[3]) == parseFloat(arrMatrix[0])) || | |
((parseFloat(arrMatrix[0]) * parseFloat(arrMatrix[3]) - parseFloat(arrMatrix[2]) * parseFloat(arrMatrix[1])) == 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
<?php | |
function getCategories(Mage_Catalog_Model_Category $ParentCategory) { | |
$return = array(); | |
foreach(explode(',', $ParentCategory->getChildren()) as $categoryId) { | |
$Category = Mage::getModel('catalog/category')->load($categoryId); | |
$return[$categoryId] = array( | |
'id' => $Category->getId(), | |
'name' => $Category->getName(), | |
'slug' => $Category->getUrlKey(), | |
'url' => $Category->getUrl(), |
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
(function($){ | |
$.fn.disableSelection = function() { | |
return this.each(function() { | |
$(this).attr('unselectable', 'on') | |
.css({ | |
'-moz-user-select':'none', | |
'-webkit-user-select':'none', | |
'user-select':'none' | |
}) | |
.each(function() { |
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
jQuery.fn.outerHTML = function() { | |
return $('<div>').append(this.eq(0).clone()).html(); | |
}; |