Skip to content

Instantly share code, notes, and snippets.

@batmask
batmask / DebugLogger.java
Created April 4, 2020 03:23
Design Pattern : Chain of Reaction Pattern sample, Logger
public class DebugLogger extends MyLogger {
DebugLogger(){
level = LOGLEVEL.D;
}
@Override
public void handleMessage(LOGLEVEL level, String msg) {
if(this.level == level){
System.out.println("DebugLogger: " + level.type + msg);
}
#copied from https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore 2020-03-12
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
@batmask
batmask / mySQLstudy.py
Created March 10, 2020 16:01
python sqlite3, mySQL basic sample
import mysql.connector
from mysql.connector import Error
from sql_queries import MySqlQueries, MyDummyData
class MariaDB:
def __init__(self):
self.connection = None
def create_connection(self, host_name, user_name, user_password, db_name):
@batmask
batmask / SwipeManager.cs
Last active November 27, 2018 18:10
Detecting touch swipe in unity C#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SwipeManager : MonoBehaviour {
private bool DEBUG = true;
public interface ISwipe{
void SwipeLeft();
void SwipeRight();
@batmask
batmask / ball.cpp
Created August 2, 2015 00:08
random sample
void ball(){
static bool isGetSeed = false;
if(!isGetSeed){
srand((unsigned int)time(NULL));
isGetSeed = true;
}
int ballNum[6] = {0, };
for(int i = 0; i < 6; i++){