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
from django.db.models.signals import post_init | |
def track_data(*fields): | |
""" | |
Tracks property changes on a model instance. | |
The changed list of properties is refreshed on model initialization | |
and save. | |
>>> @track_data('name') |
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
{-# LANGUAGE OverloadedStrings #-} | |
module TestRiak where | |
import qualified Network.Riak as R | |
import qualified Network.Riak.Protocol.MapReduce as R | |
import qualified Network.Riak.Types as R | |
import Data.Monoid | |
import Data.Aeson | |
import qualified Data.Vector as V |
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
; ---------------- | |
; Generated makefile from http://drushmake.me | |
; Permanent URL: http://drushmake.me/file.php?token=a597073754ce | |
; ---------------- | |
; | |
; This is a working makefile - try it! Any line starting with a `;` is a comment. | |
; Core version | |
; ------------ | |
; Each makefile should begin by declaring the core version of Drupal that all |
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
<?php | |
/** | |
* @file | |
* "No context" sample content type. It operates with no context at all. It would | |
* be basically the same as a 'custom content' block, but it's not even that | |
* sophisticated. | |
* | |
*/ |
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
name = VoxPelli OAuth Test | |
core = 7.x | |
dependencies[] = oauth_common | |
dependencies[] = http_client |
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
#!/usr/bin/python | |
from OpenSSL import crypto, SSL | |
from socket import gethostname | |
from pprint import pprint | |
from time import gmtime, mktime | |
from os.path import exists, join | |
CERT_FILE = "myapp.crt" | |
KEY_FILE = "myapp.key" |
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 -*- | |
from django.contrib.auth.decorators import login_required | |
from django.utils.cache import patch_response_headers | |
from django.utils.decorators import method_decorator | |
from django.views.decorators.cache import cache_page, never_cache | |
from django.views.decorators.csrf import csrf_exempt | |
class NeverCacheMixin(object): | |
@method_decorator(never_cache) |
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
/** | |
* Validate a Human Name | |
* | |
* @param $name | |
* A name as a string. | |
* @return | |
* TRUE or FALSE if name is a valid human name. | |
*/ | |
function valid_human_name($name) { | |
return preg_match("/^[A-Z][a-zA-Z '&-]*[A-Za-z]$/", $name); |
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
main :: IO () | |
main = scotty 3000 app | |
app :: ScottyM () | |
app = do | |
rcon <- liftIO $ R.connect R.defaultConnectInfo {R.connectPort = R.UnixSocket "redis.sock"} | |
get "/favicon.ico" $ html "ಠ_ಠ" | |
get "/:method" $ do |
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
#!/usr/bin/python | |
"""Replacement for htpasswd""" | |
# Original author: Eli Carter | |
import os | |
import sys | |
import random | |
from optparse import OptionParser | |
# We need a crypt module, but Windows doesn't have one by default. Try to find |
OlderNewer