This file contains 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 | |
// | |
// Routing.php | |
// ===========================================================================+ | |
return urlpatterns(array( | |
url('^$', 'content.view.index', 'index'), | |
include_urlpatterns('^/friend/', 'content.urls', 'friend'), | |
)); |
This file contains 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
# some credit to https://github.com/maddox/magick-installer | |
require 'formula' | |
def ghostscript_srsly? | |
build.include? 'with-ghostscript' | |
end | |
def ghostscript_fonts? | |
File.directory? "#{HOMEBREW_PREFIX}/share/ghostscript/fonts" | |
end |
This file contains 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=utf8-*- | |
from django.utils.translation import ugettext_lazy as _ | |
from django import forms | |
from django.forms.widgets import MultiWidget | |
class SplitPhoneNumberWidget(MultiWidget): | |
u""" | |
電話番号ウィジェット | |
[te1]-[te2]-[te3]みたいな感じで入力が出来るよ。 |
This file contains 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/env python | |
# -*- coding: utf-8 -*- | |
import smtpd | |
import asyncore | |
import email | |
from email.message import Message | |
from email.header import decode_header | |
from email.utils import parseaddr | |
from optparse import OptionParser |
This file contains 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=utf8-*- | |
from __future__ import absolute_import, unicode_literals | |
from django.utils import six | |
from django.forms.forms import get_declared_fields | |
from django.forms.models import BaseModelForm | |
from django.forms.widgets import media_property | |
from django.utils.datastructures import SortedDict | |
def fields_for_model(model, fields=None, exclude=None, widgets=None, error_messages=None, formfield_callback=None): |
This file contains 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
class Thumb(object): | |
def __init__(self, path): | |
self.url = 'http://hoge.com' + path | |
self.path = path | |
class ThumbDiscriptor(object): | |
BASE_PATH = '/img/{0}/{0}_{1}.{2}' | |
def __init__(self, name): | |
self.name = name |
This file contains 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
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo sh -c "echo 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' > /etc/apt/sources.list.d/docker.list" | |
sudo apt-get update | |
sudo apt-get purge lxc-docker |
This file contains 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 subprocess | |
class Command(object): | |
def __init__(self, *args, encode='utf8'): | |
self.encode = encode | |
self.args = args | |
def __repr__(self): | |
return '<Command({})>'.format(' '.join(self.args)) |
This file contains 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 concurrent.futures | |
def wait(): | |
print('Waiting') | |
for x in range(10 ** 100): | |
z = 10 + 20 | |
print('Done') | |
This file contains 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 concurrent.futures | |
def wait(): | |
print('Waiting') | |
for x in range(10 ** 100): | |
z = 10 + 20 | |
print('Done') | |
OlderNewer