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 os.path | |
from flask import Flask | |
from flask.helpers import safe_join | |
# Injects an "mt" parameter on the URLs of static files that contains the | |
# last-modified time of the file. This allows the use of aggressive cache | |
# settings on static files, while ensuring that content changes are reflected | |
# immediately due to the new URLs. Note that if multiple servers have | |
# different mod times on files, this can cause static files to be reloaded more | |
# often than needed. |
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 os.path | |
import contextlib | |
import hashlib | |
from flask import Flask | |
from flask.helpers import safe_join | |
# Injects an "h" parameter on the URLs of static files that contains a hash of | |
# the file. This allows the use of aggressive cache settings on static files, | |
# while ensuring that content changes are reflected immediately due to the | |
# changed URLs. Hashes are cached in-memory and only checked for updates when |
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 sqlalchemy.event import listen | |
def register_citext_type(conn, con_record): | |
from psycopg2.extensions import new_type, register_type | |
from contextlib import closing | |
def cast_citext(in_str, cursor): | |
if in_str == None: | |
return None | |
return unicode(in_str, cursor.connection.encoding) | |
with closing(conn.cursor()) as c: | |
c.execute("SELECT pg_type.oid FROM pg_type WHERE typname = 'citext'") |
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
CREATE OR REPLACE FUNCTION hstore_merge(left HSTORE, right HSTORE) RETURNS HSTORE AS $$ | |
SELECT $1 || $2; | |
$$ LANGUAGE SQL; | |
CREATE AGGREGATE hstore_merge (HSTORE) ( | |
SFUNC = hstore_merge, | |
STYPE = HSTORE, | |
INITCOND = '' | |
); |
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
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Runtime.Serialization; | |
using System.ServiceModel.Channels; | |
using System.ServiceModel.Description; | |
using System.Text; | |
using System.Xml; | |
public static class SoapUtilities |
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 pydot | |
import subprocess | |
import sys | |
import re | |
print """<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Idempotency Concept Roadmap Prototype</title> | |
<link href="https://mathieu.fenniak.net/wp-content/uploads/2013/05/bootstrap.min_.css" rel="stylesheet" media="screen"> |
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 Network.HTTP | |
import Network.URI | |
import Data.Either | |
data InstanceInfo = | |
InstanceInfo { | |
apiURL :: URI, | |
companyKey :: String, | |
loginName :: String, | |
password :: String |
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 Ember from 'ember'; | |
// computedDependent is a wrapper around Ember.computed that promotes a property access pattern that | |
// ensures that a computed property declares its dependencies accurately. | |
// | |
// You create a computed property with computedDependent, passing in the getter function and the names | |
// of the dependent properties as additional arguments. The getter function will be called with a | |
// single object argument which has ES5 properties defined upon it matching the names of the dependent | |
// properties; you can then use this 'props' argument to access the dependent properties. | |
// |
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
'use strict'; | |
const fortune = require('fortune'); | |
const http = require('http'); | |
const JsonApiSerializer = require('fortune-json-api'); | |
const MemoryAdapter = require('fortune/lib/adapter/adapters/memory'); | |
const HttpSerializer = fortune.net.http.Serializer; | |
const store = fortune( | |
{ |
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
INFO global: Vagrant version: 1.8.5 | |
INFO global: Ruby version: 2.2.3 | |
INFO global: RubyGems version: 2.4.5.1 | |
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.8.5\\bin\\vagrant" | |
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded" | |
INFO global: VAGRANT_INSTALLER_ENV="1" | |
INFO global: VAGRANT_INSTALLER_VERSION="2" | |
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1" | |
INFO global: VAGRANT_LOG="debug" | |
INFO global: VAGRANT_OLD_ENV_="ExitCode=00000001" |
OlderNewer