This file contains hidden or 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
| .popup.left:before { | |
| border-left: 10px solid #71653a; | |
| border-top: 10px solid rgba(113, 101, 58, 0); | |
| border-bottom: 10px solid rgba(113, 101, 58, 0); | |
| right: -10px; | |
| top: 20px; | |
| } | |
| .popup.left:after { | |
| border-left: 10px solid #fff1be; |
This file contains hidden or 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
| var yaml = require('js-yaml') | |
| var bug = require('./issue-54.yaml') | |
| console.log( bug[38] ); | |
| console.log( bug[39] ); | |
| console.log( bug[40] ); | |
| /* |
This file contains hidden or 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
| (defn | |
| ^{:doc "mymax [xs+] gets the maximum value in xs using > " | |
| :test (fn [] | |
| (assert (= 42 (mymax 2 42 5 4)))) | |
| :user/comment "this is the best fn ever!"} | |
| mymax | |
| ([x] x) | |
| ([x y] (if (> x y) x y)) | |
| ([x y & more] | |
| (reduce mymax (mymax x y) more))) |
This file contains hidden or 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 jinja2 | |
| import markdown | |
| def safe_markdown(text): | |
| return jinja2.Markup(markdown.markdown(text, ...)) | |
| env = jinja2.Environment(...) | |
| env.filters['markdown'] = safe_markdown | |
This file contains hidden or 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
| cacheMiddleware = cacheMiddleware = (seconds) -> (req, res, next) -> | |
| res.setHeader "Cache-Control", "public, max-age=#{seconds}" | |
| next() | |
| app.get "/recent", cacheMiddleware(5 * 60), (req, res, next) -> | |
| #When someone hits /recent, nginx will cache it for 5 minutes! |
This file contains hidden or 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
| /etc/sysctl.conf: | |
| fs.file-nr = 1006336 0 1565787 | |
| fs.file-max = 1565787 | |
| net.core.rmem_max = 33554432 | |
| net.core.wmem_max = 33554432 | |
| net.ipv4.tcp_rmem = 4096 16384 33554432 | |
| net.ipv4.tcp_wmem = 4096 16384 33554432 | |
| net.ipv4.tcp_mem = 786432 1048576 26777216 |
This file contains hidden or 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 -*- | |
| """ | |
| anga: weather.views | |
| @author: maxp | |
| """ | |
| import logging; log = logging.getLogger(__name__) | |
| import time | |
| import random |
This file contains hidden or 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 -*- | |
| """ | |
| sokfor: user.middleware | |
| """ | |
| from django.http import HttpResponseRedirect | |
| from . import APP_NAME | |
| import logging |
This file contains hidden or 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 json | |
| try: | |
| from bson.objectid import ObjectId | |
| except: | |
| pass | |
| class APIEncoder(json.JSONEncoder): | |
| def default(self, obj): | |
| if isinstance(obj, (datetime.datetime, datetime.date)): |
This file contains hidden or 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://www.alessioatzeni.com/meteocons/ | |
| */ | |
| @font-face { | |
| font-family: 'MeteoconsRegular'; | |
| src: url('meteocons-webfont.eot'); | |
| src: url('meteocons-webfont.eot?#iefix') format('embedded-opentype'), | |
| url('meteocons-webfont.woff') format('woff'), |