Skip to content

Instantly share code, notes, and snippets.

View b1412's full-sized avatar
💭
I may be slow to respond.

LeonZhou b1412

💭
I may be slow to respond.
  • Auckland,NewZealand
View GitHub Profile
@arnabmitra
arnabmitra / TestContainers
Last active November 30, 2020 02:08
TestContainers Integration tests in a Spring boot Kotlin project
import com.zaxxer.hikari.HikariConfig
import com.zaxxer.hikari.HikariDataSource
import org.junit.ClassRule
import org.junit.experimental.categories.Category
import org.junit.rules.ExternalResource
import org.junit.runner.RunWith
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.context.TestConfiguration
@Leejjon
Leejjon / texturesInScene2dgame.md
Last active May 11, 2023 21:35
How to organize your stages and textures in your libGDX game

Starting out

If you have started out to build a game with libGDX, you've were probably creating and disposing textures out like this:

public class MyGdxGame extends ApplicationAdapter {
    SpriteBatch batch;
    Texture badlogic;

    @Override

public void create () {

@fractaledmind
fractaledmind / install_tesseract.sh
Last active July 9, 2019 04:52
install tesseract-ocr on a Mac
#!/usr/bin/env bash
# courtesy of : <https://ryanfb.github.io/etc/2014/11/13/command_line_ocr_on_mac_os_x.html>
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Ensure `homebrew` is up-to-date and ready
@kachayev
kachayev / css-parser.md
Last active November 12, 2022 04:20
Parsing CSS file with monadic parser in Clojure
@michaelsbradleyjr
michaelsbradleyjr / cljs-debug-macros.clj
Last active November 5, 2021 21:36
Macros and functions which facilitate the development and debugging of other macros and their supporting functions within a ClojureScript project.
(ns my-cljs.macros.debug
(:require [cljs.analyzer :as cljs]
clojure.walk))
(declare ap
cljs-macroexpand*
cljs-macroexpand-1*
cljs-macroexpand-all*
cljs-macroexpand
@mrluanma
mrluanma / http_range.py
Created July 26, 2011 14:58
HTTP Range header 的用法, 也就是传说中的断点续传, Python httplib2 示例.
1. 首先验证 web server 支持断点续传:
(django13)[www@mail ~]$ curl -i http://127.0.0.1/123.txt
HTTP/1.1 200 OK
Server: nginx/0.8.54
Date: Tue, 26 Jul 2011 14:41:53 GMT
Content-Type: text/plain
Content-Length: 10
Last-Modified: Tue, 26 Jul 2011 14:32:35 GMT
Connection: keep-alive