with mysql pgsql intl support
$ brew install php --with-apache --with-mysql --with-pgsql --with-intl
date.timezone = Europe/Vienna
require 'sidekiq/api' | |
# 1. Clear retry set | |
Sidekiq::RetrySet.new.clear | |
# 2. Clear scheduled jobs | |
Sidekiq::ScheduledSet.new.clear |
#http://stackoverflow.com/questions/5870188/does-flask-support-regular-expressions-in-its-url-routing | |
#Even though Armin beat me to the punch with an accepted answer I thought I'd show an abbreviated example of how I implemented a regex matcher in Flask just in case anyone wants a working example of how this could be done. | |
from flask import Flask | |
from werkzeug.routing import BaseConverter | |
app = Flask(__name__) | |
class RegexConverter(BaseConverter): | |
def __init__(self, url_map, *items): |
class TenantAwareManager(Manager): | |
def get_queryset(self): | |
tenant_id = current_tenant_id() | |
# If the manager was built from a queryset using | |
# SomeQuerySet.as_manager() or SomeManager.from_queryset(), | |
# we want to use that queryset instead of TenantAwareQuerySet. | |
if self._queryset_class != QuerySet: | |
return super().get_queryset().filter(tenant__id=tenant_id) |
var fs = require("fs"), | |
path = require("path"); | |
function walk(dir, callback) { | |
fs.readdir(dir, function(err, files) { | |
if (err) throw err; | |
files.forEach(function(file) { | |
var filepath = path.join(dir, file); | |
fs.stat(filepath, function(err,stats) { | |
if (stats.isDirectory()) { |
// | |
// LoadingOverlay.swift | |
// app | |
// | |
// Created by Igor de Oliveira Sa on 25/03/15. | |
// Copyright (c) 2015 Igor de Oliveira Sa. All rights reserved. | |
// | |
// Usage: | |
// | |
// # Show Overlay |
from lxml.html import fromstring as html, tostring as tos | |
from requests import get | |
import xmltodict | |
import json | |
results = [] | |
URL = 'http://vermont.craigslist.org/search/apa' | |
for el in html(get(URL).text).xpath("//p[@class='row']"): | |
results.append(xmltodict.parse(tos(el))) |
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
utc_to_local.py | |
Example of converting UTC to local time using python-dateutil. | |
https://pypi.python.org/pypi/python-dateutil | |
""" | |
from datetime import datetime |
#lang racket | |
(require db) | |
(require "utils.rkt") | |
; open a connection to our database | |
(define (call-with-conn db proc) | |
(let ([conn (sqlite3-connect #:database db | |
#:mode 'read/write)]) | |
(proc conn))) |
#!/usr/bin/env ruby | |
# Please read http://otobrglez.opalab.com for more information about this code. | |
class Book < Struct.new(:title) | |
def words | |
@words ||= self.title.gsub(/[a-zA-Z]{3,}/).map(&:downcase).uniq.sort | |
end |