Skip to content

Instantly share code, notes, and snippets.

View zhenyanghua's full-sized avatar
🐢
I may be slow to respond.

Zhenyang Hua zhenyanghua

🐢
I may be slow to respond.
View GitHub Profile
@zhenyanghua
zhenyanghua / main.lua
Last active August 10, 2021 00:53
Eight queens puzzle
--[[
List all solutions that eight queens on the chess board can't attach each other
example output:
x - - - - - - -
- - - - x - - -
- - - - - - - x
- - - - - x - -
- - x - - - - -
- - - - - - x -
@zhenyanghua
zhenyanghua / conf.lua
Created August 6, 2021 00:47
Playground - Life
function love.conf(t)
t.window.title = "life"
t.window.width = 350
t.window.height = 600
end
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@zhenyanghua
zhenyanghua / semver.js
Last active January 19, 2021 00:23
semver browser port
window.SemVer = (function () {
'use strict';
function createCommonjsModule(fn) {
var module = { exports: {} };
return fn(module, module.exports), module.exports;
}
// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
;(function(exports) {
// export the class if we are in a Node-like system.
if (typeof module === 'object' && module.exports === exports)
exports = module.exports = SemVer;
// The debug function is excluded entirely from the minified version.
// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
@zhenyanghua
zhenyanghua / .block
Created January 17, 2021 00:57 — forked from d3indepth/.block
Spinning globe
license: gpl-3.0
height: 440
border: no
@zhenyanghua
zhenyanghua / .block
Created January 16, 2021 17:13 — forked from d3indepth/.block
D3 geo lines, circles and graticule
license: gpl-3.0
height: 420
border: no
@zhenyanghua
zhenyanghua / Docker.md
Last active November 6, 2018 03:31
K8s Notes

Inspect container and filter by its property

docker inspect -f '{{ .NetworkSettings.IPAddress }}' container_name

Run a nginx container in a detached interactive terminal that maps the host port 8088 to the nginx webserver port and open a shell in the interactive terminal.

docker run -dit --name my-nginx -p 8088:80 nginx /bin/bash 
@zhenyanghua
zhenyanghua / SearchArt.java
Last active September 7, 2018 17:56
OOA&D wk1
import java.util.List;
import java.util.LinkedList;
class ArtWork {
private String serialNumber;
private double price;
private String material;
private String type;
private String series;
@zhenyanghua
zhenyanghua / FtpUtility.cs
Last active January 22, 2018 14:44
Facade Pattern Example
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using NLog;
using WebGrease.Css.Ast.Selectors;