Skip to content

Instantly share code, notes, and snippets.

View sunghwan2789's full-sized avatar

Sunghwan Bang sunghwan2789

View GitHub Profile
@peppy
peppy / osuStacking.cs
Created August 24, 2011 07:18
osu! stacking algorithm
/* Stacking used in osu! formats v6+. (c) peppy 2011
* Versions previous to 6 had incorrect stacking, but is maintained for scoring purposes.
* For non-osu! clones there should be no problem using the following alogrithm for all format versions.
*/
StackOffset = HitObjectRadius / 10; //ymmv
Vector2 stackVector = new Vector2(StackOffset, StackOffset);
const int STACK_LENIENCE = 3;
@vittorioromeo
vittorioromeo / FastFunc.hpp
Last active August 24, 2023 08:15
Don Clugston's fast delegate C++11 implementation
#ifndef SSVU_FASTFUNC
#define SSVU_FASTFUNC
#include <cstring>
#include <type_traits>
#include <cassert>
#include <cstddef>
#include <memory>
#include <new>
#include <utility>
@fmtarif
fmtarif / gist:11244153
Last active December 1, 2019 18:10
#mysql - MySQL common fields/columns type and size
# http://stackoverflow.com/questions/354763/common-mysql-fields-and-their-appropriate-data-types
INT(11) for anything that is either an ID or references another ID
DATETIME for time stamps
VARCHAR(255) for anything guaranteed to be under 255 characters (page titles, names, etc)
TEXT for pretty much everything else.
VARCHAR(255) for emails
TIMESTAMP for dates, tracking creation or changes
DECIMAL(3,2) (unsigned) for 5-star rating value
# -*- coding: utf-8 -*-
import hashlib
import urllib2
import xml.dom.minidom as xml
ALSONG_URL = "http://lyrics.alsong.net/alsongwebservice/service1.asmx"
ALSONG_TMPL = '''\
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="ALSongWebServer/Service1Soap" xmlns:ns1="ALSongWebServer" xmlns:ns3="ALSongWebServer/Service1Soap12">
<SOAP-ENV:Body>
@jung-kim
jung-kim / map-perf.js
Last active May 25, 2023 07:01
es6 map vs array vs obj performance test
"use strict";
let looper = (callback) => {
let n = 2000000;
while (n > 0) {
callback(n);
n--;
}
}
@briceburg
briceburg / Dockerfile.fails
Created March 30, 2016 22:17
docker - example adding www-data user to alpine images
FROM nginx:alpine
# stock verison from php:alpine image
# ensure www-data user exists
RUN set -x \
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data
# 82 is the standard uid/gid for "www-data" in Alpine
# http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2
@bigonese
bigonese / vpn.sh
Created January 11, 2017 13:06
Script to start sstp-client on a Mac, connecting to Microsoft VPN, with ability to use Apple's KeyChain
#!/bin/bash
SERVICE_NAME='my-example-vpn'
SERVICE_URL='my-example-vpn.com'
if [[ ${#USER} > 1 ]]
then
read -p "Log in as ${USER}? [y/n] " LIA
else
LIA = 'n'
@SKempin
SKempin / Git Subtree basics.md
Last active June 27, 2024 07:56
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@slikts
slikts / immer-underrated.md
Last active October 30, 2023 07:43
Appreciating the elegant simplicity of Immer

nelabs.dev

Appreciating the elegant simplicity of Immer

There is an ongoing shift in programming towards a more constrained mindset, recognizing shared mutable state and side effects as significant sources of accidental complexity and concepts like immutability and reactive, unidirectional pipelines as ways to overcome it. Simplicity is less optional than before, based on an understanding about the limited capacity of human working memory and based on programming language theory and practice. The functional programming ideas seeping into the mainstream leave less people to say that they wouldn't need them because of maybe never having used them.

The basic idea of controlling complexity through constraints is not novel at all, though, and it raises a valid question about why this shift has taken so long to develop, despite the overall trends towards automation and productivity. For example, the distincti

https://archive.is/llRty#selection-1131.0-1504.0
우선 국내.
1.레오폴드. http://www.leopold.co.kr/
키캡을 사면 본체를 주는 국내 최고의 키캡 판매 회사.
2. 펀키스. http://funkeys.kr/
바밀로, 더키 키보드 유통 회사. 키캡 세트도 판매 중.
기본적으로 충분한 값어치는 하는 듯.