Skip to content

Instantly share code, notes, and snippets.

@t-kashima
t-kashima / ViewController.swift
Created May 11, 2015 16:00
MutipeerConnectivityを使った画像のやりとり
//
// ViewController.swift
// Multipeer
//
// Created by Kashima Takumi on 2015/05/11.
// Copyright (c) 2015年 UNUUU FOUNDATION. All rights reserved.
//
import UIKit
import MultipeerConnectivity
#!/usr/bin/env xcrun swift
import Foundation
import Cocoa
public class SelfTimer: NSObject {
let TimerInterval: NSTimeInterval = 3600
var timer: NSTimer?
@t-kashima
t-kashima / Square.cpp
Last active August 29, 2015 14:18
Draw square for C++
#include "Square.h"
Square::Square()
: _linearType(LinearTypeTop)
, _lineLength(0)
, _alpha(0)
{
}
Square::~Square()
@t-kashima
t-kashima / index.html
Last active August 29, 2015 14:17
Three.jsで林檎(STL)をくるくる
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Threejs / Apple</title>
<style>body { background-color: black; margin: 0px; padding: 0px; } canvas { width: 100%; height: 100% }</style>
</head>
<body>
<script src="three.min.js"></script>
<script src="OrbitControls.js"></script>
@t-kashima
t-kashima / Circle.cpp
Last active August 29, 2015 14:17
Openframeworks draw cirlces
#include "Circle.h"
Circle::Circle(float x, float y, float r)
{
_x = x;
_y = y;
_r = r;
_color.r = ofRandom(255);
_color.g = ofRandom(255);
@t-kashima
t-kashima / qrcode.rb
Created March 25, 2015 06:43
QRCode for Ruby
# -*- encoding: utf-8 -*-
require 'rqrcode'
require 'rqrcode_png'
require 'chunky_png'
qr = RQRCode::QRCode.new('Hello, world', :size => 3, :level => :h)
png = qr.to_img
png.resize(200, 200).save('qrcode.png')
<?php
/**
* WordpressのXMLから使われている画像をダウンロードする
*
* $argv[1] -> WordpressでエクスポートしたXML
* $argv[2] -> ダウンロードした画像の保存場所
*/
$xml_file_path = $argv[1];
$image_dir_path = $argv[2];
#include "CustomButton.h"
USING_NS_CC;
CustomButton *CustomButton::createWithFile(const std::string& filename)
{
CustomButton *pRet = new CustomButton();
if (pRet && pRet->initWithFile(filename)) {
pRet->autorelease();
return pRet;
set-option default-shell /bin/zsh
set-option -g prefix C-t
unbind C-b
bind C-t send-prefix
# ウィンドウ・ペインの最初の番号を指定を1に。デフォルトだと0から
set -g base-index 1
set -g pane-base-index 1set -g mouse-select-pane on
autoload -U compinit
compinit
zstyle ':completion:*:default' menu select=1
# when tmux down
if [ "$TMUX" = "" ]; then
# tmux wake up!!!
tmux;
fi