Skip to content

Instantly share code, notes, and snippets.

View jiyuujin's full-sized avatar
🐬
o(^_-)O

YUMA Kitamura jiyuujin

🐬
o(^_-)O
View GitHub Profile
@kikuchy
kikuchy / main.dart
Last active March 18, 2021 12:50
null-safety explanation
import "package:flutter/material.dart";
final VoidCallback? nullableFunction = null;
final Map<String, String>? nullableMap = null;
void main() {
// これはnon-null
final int a = 1;
// なのでこれは静的型検査でエラーになる
y=201904;eval(c=(%w(c=("y=#{y^1};eva
l(c=(%w(#{c})*'').gsub(/#{92.chr}x1B
.7?m/,''))").chars;370.times{|i|x=27
.chr;$><<(i%37==36?$/:[x+"[7m%s"+x+"
[m",'%s']['t97hors0ui06fp5kk6ug8vdyd
oklqdkjbg8mtphndhtu3q9c31wxne49wpe6m
rkconuqfjo85ezlffy7zga7m6eagpkyij5bf
cfg9yn1jb8vyynfkv2y3noz9jc4f1t3lkf17
ehg3nk0pa7'.to_i(36)[(y&1)*370+i]]%[
c.shift])})*'').gsub(/\x1B.7?m/,''))
@mogaming217
mogaming217 / checka-firestore.rules
Created February 6, 2019 02:46
何かおかしそうなところがあれば教えてください。
service cloud.firestore {
match /databases/{database}/documents {
match /groups/{groupID} {
allow get, update: if isAuthenticated() && isUserBelongingToThisGroup(groupID, request.auth.uid);
match /users/{userID} {
allow read: if isAuthenticated() && isUserBelongingToThisGroup(groupID, request.auth.uid);
}
match /boards/{boardID} {
@technoknol
technoknol / Enable CORS in Laravel 5.4.php
Created April 26, 2017 14:10
Enable CORS in laravel 5.4
<?php
# File: app\Http\Middleware\CORS.php
# Create file with below code in above location. And at the end of the file there are other instructions also.
# Please check.
namespace App\Http\Middleware;
use Closure;
class CORS {
@jiyuujin
jiyuujin / Action.cpp
Last active September 20, 2016 10:25
Actionを利用する際「連続タップを考慮せず」に注意。一方連続タップに無関係なschedule_selector
private:
bool pFlag = false;
void GameScene::Create() {
this->scheduleOnce( schedule_selector( GameScene::DisableFlag ), 3 );
this->runAction( Sequence::create( DelayTime::create(3), CallFunc::create([this] () { DisableFlag(); }), NULL );
}
@jiyuujin
jiyuujin / CrossFade.cpp
Last active July 25, 2016 08:35
背景クロスフェード(0.2sec)
void MenuState_PlayPerformance::playCharacter() {
replaceImage( (Sprite*)mScene->getContentsSprite()->getChildByName("background"), "bg2.png" );
}
void MenuState_PlayPerformance::replaceImage(cocos2d::Sprite* sprite, const char* imageFileName) {
sprite->setTexture( Director::getInstance()->getTextureCache()->addImage( imageFileName ) );
Texture2D *tex = Director::getInstance()->getTextureCache()->addImage( imageFileName );
sprite->setTexture( tex );
Size contentSize = tex->getContentSize();
sprite->setTextureRect( Rect(0, 0, contentSize.width, contentSize.height) );
@gkthiruvathukal
gkthiruvathukal / c9-setup-java8+sbt.sh
Created February 20, 2016 04:44
Setting up Java 8 + SBT on Cloud 9
# Java 8
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
# https support (kind of lame)
sudo apt-get install apt-transport-https
# SBT
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
@jiyuujin
jiyuujin / HowToDLNA.md
Last active August 31, 2016 09:51
Used DLNA/P2P, HowToBuild, UPnP, SOAP
  • DMC (Control Point)
  • DMS (Server)
  • DMP (Player)
  • DMR (Renderer)
Android iOS
App Java ObjC
Wrapper
- Complaints
@cloned
cloned / WWWClient.cs
Last active October 12, 2017 16:45
A handy class to use WWW and WWWForm on Unity.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace WWWKit
{
/// <summary>
/// A handy class to use WWW class and WWWForm class.
///
/// Features: