Skip to content

Instantly share code, notes, and snippets.

Programus programus

Block or report user

Report or block programus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@programus
programus / README-cdx.md
Last active Mar 27, 2020
Extended windows cd command
View README-cdx.md

CDX Command - CD eXtension batch file

This is a batch file could help you change working directory easier especially you need to change many directories very often like me.

Features

  • Save histroy of all navigated directories
  • No duplicated directories in histroy
  • Name history directories
  • Jump into any directory in histroy by index or name
  • Quich jump into previous directory
  • Maintain history list
@programus
programus / tcpclient.go
Last active Aug 30, 2019
go tcp server/client
View tcpclient.go
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"net"
"io"
"time"
@programus
programus / from.html
Last active Aug 29, 2015
close popup after changed html
View from.html
<!DOCTYPE html>
<html lang="ja-JP">
<head>
<title>From</title>
<meta charset="UTF-8">
</head>
<body onload="document.getElementById('closed-flg').checked = true;">
<input type="checkbox" id="closed-flg"/>
<a href="#" onclick="window.open('popup.html', 'popup'); document.getElementById('closed-flg').checked = false; ">popup</a>
<a href="#" id="link-to" onclick="window.location.href='to.html' + (document.getElementById('closed-flg') ? '' : '?popup');">To</a>
@programus
programus / mine.sh
Last active Aug 29, 2015
mine sweeper shell version
View mine.sh
#!/bin/bash
MINE="@"
BOOM="X"
BLANK=" "
NEW="."
MARK="M"
OPEN_FLAG=1
MARK_FLAG=2
@programus
programus / planes.sh
Created Aug 3, 2014
Hit plane game in shell script
View planes.sh
#!/bin/sh
HIT="X"
BLANK="."
function printBanner()
{
echo "****************************"
echo "* PLANE *"
echo "****************************"
@programus
programus / guess.sh
Last active Aug 29, 2015
guess number game in shell script
View guess.sh
#!/bin/sh
# 猜数字游戏Shell版程序
function generateGoal()
{ # 生成被猜数字
# 准备一个包含0-9的池
local pool=($(seq 0 9))
for i in $(seq 0 3)
do
@programus
programus / JsonUtilities.cs
Created Apr 1, 2012
Functions to convert string(utf-8 in c++) to \uXXXX unicode escape
View JsonUtilities.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
namespace CIS_StdWebServices.Utils
{
public class JsonUtilities
{
@programus
programus / index.html
Last active Jun 23, 2016
Javascript Game Memory
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>memory</title>
<meta name="description" content="A memory game." />
<meta name="author" content="Programus" />
@programus
programus / data-table.css
Created Mar 7, 2012
CSS & head to set data table format in Octopress
View data-table.css
* + table {
border-style:solid;
border-width:1px;
border-color:#e7e3e7;
}
* + table th, * + table td {
border-style:dashed;
border-width:1px;
border-color:#e7e3e7;
@programus
programus / NewOrNot.java
Created Mar 6, 2012
String initialization in Java
View NewOrNot.java
import java.lang.ref.WeakReference;
/**
* Class to research strings.
* constant string like "AAA" won't be reclaimed while instance created by new will.
* when you new a String by a constant string, there will be two memory field stored the same value.
* so initialize a String by constant String is recommended.
* @author Programus
*/
public class NewOrNot {
You can’t perform that action at this time.