The navigation sidebar on the left is shown on hover
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 django.core.cache import cache | |
from django.core.urlresolvers import reverse | |
from django.http import HttpRequest | |
from django.utils.cache import get_cache_key | |
def expire_page_cache(view, args=None): | |
""" | |
Removes cache created by cache_page functionality. | |
Parameters are used as they are in reverse() | |
""" |
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
file{ [ '/backups', '/backups/redis' ]: | |
ensure => 'directory', | |
owner => 'root' | |
} | |
cron{ 'redis-bgsave': | |
command => 'redis-cli bgsave', | |
user => 'root', | |
hour => '0-23/2', | |
minute => 3, | |
} |
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
type t('a) = ReasonUrql.Types.response('a); | |
let map: (t('a), 'a => 'b) => t('b) = | |
(response, fn) => | |
switch (response) { | |
| Fetching => Fetching | |
| NotFound => NotFound | |
| Error(error) => Error(error) | |
| Data(data) => Data(fn(data)) | |
}; |
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 -*- | |
import os | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") | |
import newrelic.agent | |
newrelic.agent.initialize(os.path.join(os.path.dirname(os.path.dirname(__file__), 'newrelic.ini') | |
from django.core.wsgi import get_wsgi_application | |
application = get_wsgi_application() |
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
#!/bin/bash -eux | |
NAME=$1 | |
VERSION=$2 | |
FLOW_VERSION=0.25.x | |
echo $NAME@$VERSION | |
DIRECTORY=$(dirname $0)/definitions/npm/${NAME}_v$VERSION |
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 _ from 'lodash' | |
export const get = (path, data) => { | |
const collection = JSON.parse(localStorage.getItem(path)) || [] | |
if (data && data.id) { | |
return Promise.resolve(_.find(collection, ['id', data.id])) | |
} | |
return Promise.resolve(collection) | |
} |
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
# Define: postgresql::backup | |
# | |
# Backup of a postgresql database using pgdump. | |
# Usage: postgresql::backup { [ 'db1', 'db2' ]: } | |
define postgresql::backup { | |
file{ [ '/backups', '/backups/postgres', "/backups/postgres/${title}" ]: | |
ensure => 'directory', | |
owner => 'postgres' | |
} |
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> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
var id, | |
image = $("#image"), | |
current = 0, | |
urls = [ |
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
language: python | |
python: | |
- "2.6" | |
- "2.7" | |
env: | |
- DJANGO_VERSION=1.4 | |
- DJANGO_VERSION=1.5 |
NewerOlder