Skip to content

Instantly share code, notes, and snippets.

View Rokt33r's full-sized avatar
🧨
BOOM!

Junyoung Choi Rokt33r

🧨
BOOM!
View GitHub Profile
@Rokt33r
Rokt33r / .md
Created April 28, 2015 07:35
AWS Ubuntu setup for Laravel

AWS Ubuntu Setup

Overview

  • php5.6(php-fpm) for Laravel
  • nginx

1. Install Packages

sudo apt-get update && sudo apt-get install python-software-properties
@Rokt33r
Rokt33r / FunctionalHelper.php
Last active August 29, 2015 14:14
CodeceptionでのMockを使ったFacadeのテスト / Using Mock to test Facade with Codeception for Laravel ref: http://qiita.com/fluke8259/items/98e6b2d82f214fc91230
<?php namespace Codeception\Module;
class FunctionalHelper extends \Codeception\Module
{
public function getApp(){
return $app = $this->getModule('Laravel4')->kernel;
}
public function readyMailerMock(){
$mock = \Mockery::mock('Mailer');
$this->getApp()['mailer'] = $mock;
@Rokt33r
Rokt33r / 1.md
Created December 27, 2014 09:56
Angular 1st - Project init

Project init

BowerとNPMの初期設定をする。

global package

install

npm install -g bower grunt-cli karma-cli
@Rokt33r
Rokt33r / e2e.md
Created November 1, 2014 08:42
End to End Test with Headless browser

End to End Test with Headless browser

AngularJSなどのFrontendまで関わっている環境をテストするためには実際にユーザが使うBrowseまで用いる必要がある。 こう言う全体を考えたテストをEnd to End Test (以下E2E)と呼ぶ。

今回はE2Eテストをするとき、Headless browserを用いてみる

Headless browserとは、ホームページを画面に表示ずにコードのままで起動するBrowserである。

Headless Browserを使う時に得られる長所

  1. レンダリングをする必要がないので速い。
@Rokt33r
Rokt33r / main.py
Last active August 29, 2015 14:03
simple text editor
from tkinter import *
from tkinter.filedialog import *
master = Tk()
tf = Text(master, bg="white", bd=0)
tf.pack(fill=BOTH, expand=1)
def hello():
print(tf.get("1.0", END))
print("END")
@Rokt33r
Rokt33r / inc.py
Created July 9, 2014 05:50
上場率の計算
import sys
from tkinter import *
from math import *
R = 287.05
p = 101300
T = 15+273.15
rho = p/R/T
cLmax = 2.0
@Rokt33r
Rokt33r / 10.md
Created July 2, 2014 06:56
Python 4th week

GUI

今回からはGUIを使ってみる。GUIとはGraphic User Interfaceを略した言葉であって、 Terminalのようにデータを文字だけじゃなくて、絵としても表してくれる。

つまり、計算の結果を絵で表すことで、グラフを書いたりなどいろんなデータをいろんなやり方で視覚化することができる。

Tkinter

TkinterはPythonに基本的に入っているモジュールでこれを用いれば、簡単にGUIプログラムが作れる。 >これ以外もPySide、PyQTなどいろんなモジュールがあるが、Tkinterがかなり使いやすかったのでここではTkinterを使う。

@Rokt33r
Rokt33r / 7.md
Last active August 29, 2015 14:02
Python 3rd week

Function(関数)

今回はFortranのSubroutineのような役割をするFunctionを使ってみよう。

書き方

関数もifwhileのようにインデントで関数の中なのか外なのかを判断する。

例は次のようになる。

def plusOne(x) :
	x = x + 1
@Rokt33r
Rokt33r / python4.md
Last active August 29, 2015 14:02
Python 2nd week

Control statement(制御文)

制御とは?

今回は実際にPythonを制御する制御門を学んでみる。

Conditional(条件文 : if)

PythonはCとは違って括弧で囲まずに、インデント(タブ)を入れて、statementの範囲を表す。

つまり、書き方において強制的にタブをしっかり入れなきゃならないようになっている。

@Rokt33r
Rokt33r / python1.md
Last active August 29, 2015 14:02
Python Intro(1st week)

Pythonとは

1990年Guido Van Rossumが作ったプログラミング言語である。

紹介

簡潔という美しさ

Pythonは、他の言語と違って、多様性より最も美しい答え一つを好む。 これは、コードの書き方にも適用されて、自分が書いていないコードでも、かなり読みやすい。

There is only one solution