I hereby claim:
- I am masom on github.
- I am masom (https://keybase.io/masom) on keybase.
- I have a public key whose fingerprint is A335 A2A0 DD22 8705 1E58 9EF9 39AB 34CA F07F 7B2B
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# -*- coding: utf-8 -*- | |
from flask import Blueprint, request | |
from .middlewares import (m, validate) | |
posts = Blueprint('posts', __name__, url_prefix='/posts') | |
def index(): | |
posts = dict() | |
return dict(posts=posts) |
module MusicCleaner | |
class Cleaner | |
def initialize(dir, musicfiles = nil) | |
@types = musicfiles || ['.mp3', '.ogg', '.flac', '.m4a', '.aac'] | |
@delete = ['.ini', '.txt', '.nfo', '.db', '.m3u'] | |
@skip = ['.', '..'] | |
@dir = dir | |
end | |
def clean!(dir = nil) | |
dir = dir || @dir |
set encoding=utf-8 | |
set nocompatible " be iMproved | |
filetype off " required! | |
set t_Co=256 | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
Bundle 'gmarik/vundle' |
#TODO: compute recipe food values | |
namespace :recipe do | |
desc "Imports JSON recipes" | |
task :json_import, [:source, :basepath] => :environment do |task,args| | |
require 'rubygems' | |
require 'json' | |
def import_recipe(source, raw) | |
recipe = Recipe.new | |
recipe.name = raw['name'] |
/** | |
* Example of a production database called "db_prod" connecting to a replica set | |
* running on two systems, "db1" and "db2" with the replica set name of "prod_01". | |
* | |
* This setup assumes that you're running a recent version of MongoDB as well as | |
* the PHP extension. | |
**/ | |
Connections::add('default', array( | |
'production' => array( | |
'type' => 'MongoDb', |
#http://erikonrails.snowedin.net/?p=212 | |
desc "Imports a CSV file into an ActiveRecord table" | |
task :csv_model_import, :source, :model, :needs => :environment do |task,args| | |
def import_csv(classname, options = {}) | |
lines = File.new(options[:filename]).readlines | |
header = lines.shift.strip | |
keys = header.split(',') | |
model = Module.const_get(classname) |
section: screens | |
msamson: | |
heroku-2: | |
end | |
section: links | |
msamson: | |
right(10,100) = heroku-2(10,100) | |
heroku-2: | |
left(10,100) = msamson(10,100) | |
end |
production: | |
email_delivery: | |
delivery_method: :async_smtp | |
smtp_settings: | |
tls: true | |
enable_starttls_auto: true | |
address: "smtp.gmail.com" | |
port: '587' | |
domain: "smtp.gmail.com" | |
authentication: :plain |
<?php | |
public function pin(Array $params=array()) | |
{ | |
$pin=""; | |
$options = array(); | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$q = "SELECT grv.ip_address,grs.printing_pin FROM guest_room_view grv INNER JOIN guest_room_settings grs on grv.room_id=grs.guest_room_id"; | |