Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryutaro Yamakawa ryuchan00

View GitHub Profile
@ryuchan00
ryuchan00 / block.pde
Created Aug 16, 2020
ブロック崩し
View block.pde
final int numBlocksCols = 5, numBlocksRows = 10;
final int numBlocks = numBlocksCols * numBlocksRows;
final int blockWidth = 30, blockHeight = 10, space = 2;
final int padWidth = 40, padHeight = 10;
final color std_colors[] = {color(255, 0, 0) // red
, color(255, 0, 255) // magenta
, color(255, 255, 0) // yellow
, color(0, 255, 255) // cyan
, color(0, 255, 0) // green
};
@ryuchan00
ryuchan00 / circleStars.pde
Created May 23, 2020
シンガポール🇸🇬みたいな円状に均等に星を配置するやつ
View circleStars.pde
// 🇸🇬
size(120, 120);
background(255);
noStroke();
fill(152, 251, 152);
int a[] = {1,4,2,5,3};
int b;
float x;
float y;
@ryuchan00
ryuchan00 / easyStar.pde
Created May 23, 2020
簡単なロジックで星を作る
View easyStar.pde
size(60, 60);
background(255);
noStroke();
fill(152, 251, 152);
int b;
int a[] = {1,4,2,5,3};
beginShape();
for (int i = 0; i < 5; i++) {
View count.c
#include <stdio.h>
int main(void)
{
int i = 0;
// 今は入力値は101を与えてあげる。出力は1が文字列中に2つなので2になる
char *str = "101";
int counter = 0; // strに1が何回あるか数える変数
while (※strの文字列の長さの回数繰り返す)
{
View 0.c
#include <stdio.h>
int main()
{
int a, b, c;
a = 1;
b = 2;
c = 3;
char s[101];
s = 'test';
// 整数の入力
@ryuchan00
ryuchan00 / .Xmodmap
Created May 18, 2019
caps lockをcontrolと入れ替える
View .Xmodmap
remove Lock = Caps_Lock
keysym Caps_Lock = Control_L
add Control = Control_L
View ensyu1c.asm
load A
sub B
ifp ABig
ifn BBig
ABig:load A
store Z
jump CompC
BBig:load B
store Z
jump CompC
@ryuchan00
ryuchan00 / sample_app_deploy.sh
Created Mar 28, 2018
Deploying SampleApp to Dokku.
View sample_app_deploy.sh
# [Dokku - The smallest PaaS implementation you've ever seen](http://dokku.viewdocs.io/dokku/deployment/application-deployment/#deploying-to-dokku)
# login root user.
dokku apps:create ruby-rails-sample
# install the postgres plugin
# plugin installation requires root, hence the user change
dokku plugin:install https://github.com/dokku/dokku-postgres.git
# create a postgres service with the name rails-database
@ryuchan00
ryuchan00 / install_dokku.sh
Last active Mar 28, 2018
Install dokku script.
View install_dokku.sh
# [Dokku - The smallest PaaS implementation you've ever seen](http://dokku.viewdocs.io/dokku/getting-started/installation/)
# for debian systems, installs Dokku via apt-get
cd ~/
wget https://raw.githubusercontent.com/dokku/dokku/v0.11.6/bootstrap.sh
sudo DOKKU_TAG=v0.11.6 bash bootstrap.sh
View convert_hash_syntax_spec.rb
# example(it)内でローカル変数を宣言する
describe 'convert_hash_syntax' do
it '=>が:に置き換わる' do
old_syntax = <<~TEXT
{
:name => 'Alice',
:age => 20,
:gender => :female
}
TEXT