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))) |
namespace :deploy do | |
desc "Hot-reload God configuration for the Resque worker" | |
task :reload_god_config do | |
sudo "god stop resque" | |
sudo "god load #{File.join(deploy_to, 'current', 'config', 'resque-' + rails_env + '.god')}" | |
sudo "god start resque" | |
end | |
end | |
# append to the bottom: |
virtualenv --no-site-packages . | |
source bin/activate | |
bin/pip install tornado | |
bin/pip freeze > requirements.txt | |
mkdir app | |
git init | |
cat >.gitignore <<EOF | |
bin/ | |
include/ | |
lib/ |
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
</head> | |
<body> | |
<div id="map" style="width: 100%; height: 100%"></div> | |
<script> | |
var map = new L.Map('map'); | |
var osm = new L.TileLayer('http://tile.osm.org/{z}/{x}/{y}.png'); |