Skip to content

Instantly share code, notes, and snippets.

View giginet's full-sized avatar
🌴
年中On vacation

Kohki Miki giginet

🌴
年中On vacation
View GitHub Profile
@giginet
giginet / test.log
Created March 26, 2017 08:48
Running tests on MySQL
(third-impact) third-impact (mysqlclient) ✗ python manage.py test kawaz.apps
Creating test database for alias 'default'...
Got an error creating the test database: (1007, "Can't create database 'test_kawaz_development'; database exists")
Type 'yes' if you would like to try deleting the test database 'test_kawaz_development', or 'no' to cancel: yes
Destroying old test database for alias 'default'...
.....................................................FF.F..FFFFF...........FFFFFFFFFF......................................................FF.................................F.F.FFFF......F......FFFFFF...............................................................................................F.F......F........FFFFFF........................................................................................................F..........................................................................................................................E.E..F............FFF.....FFFFFFFFFFFFFFF.................................
@giginet
giginet / error.txt
Created March 25, 2017 07:59
error
:Creating test database for alias 'default'...
.....................................................FF.F..FFFFF...........FFFFFFFFFF......................................................FF.................................F.F.FFFF......F......FFFFFF...............................................................................................F.F......F........FFFFFF........................................................................................................F..........EEEE....E.......................................................................................................E.E..F............FFF.....FFFFFFFFFFFFFFF.......................................
======================================================================
ERROR: test_member_can_create_package_release_via_product_form (kawaz.apps.products.tests.test_views.ProductCreateViewTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/giginet/third-impact/src/kawa
File.open('members.csv', 'r') do |file|
file.each_line do |line|
name, email, _, _ = line.split(',')
puts "#{name} <#{email}>"
end
end
@giginet
giginet / PureLayout+Extension.swift
Last active September 6, 2016 15:21
PureLayoutExtension
import UIKit
import PureLayout
extension CollectionType where Generator.Element == NSLayoutConstraint {
func autoInstallConstraints() {
(self as! NSArray).autoInstallConstraints()
}
func autoRemoveConstraints() {
(self as! NSArray).autoRemoveConstraints()
@giginet
giginet / operator.swift
Created August 2, 2016 15:34
||= operator in Swift
infix operator ||= { associativity left precedence 150 }
public func ||= <T>(lhs: inout T?, rhs: T?) {
if lhs == nil { lhs = rhs }
}
var a: Int? = nil
a ||= 10
print(a)
fn main() {
for n in 0..100 {
if n % 15 == 0 {
println!("FizzBuzz")
} else if n % 5 == 0 {
println!("Buzz")
} else if n % 3 == 0 {
println!("Fizz")
} else {
println!("{}", n)
@giginet
giginet / sound.py
Created August 28, 2015 15:55
Sound generation in Python
import sys
import math
import wave
import array
DURATION = 3
FREQUENCY = 440
VOLUME = 100
SAMPLERATE = 44100
DATASIZE = 2

Decksetがよかった話


自己紹介

@giginet
giginet / 0_reuse_code.js
Created March 20, 2014 10:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# -*- coding: utf-8 -*-
#
# cocos2d-x-icon-generator.py
# created by giginet on 2014/02/27
#
import sys
from PIL import Image
SIZES = (
(29, 29),
(40, 40),