Skip to content

Instantly share code, notes, and snippets.

View yeahnoob's full-sized avatar
🏠
Working from home

Xanadu Zhang yeahnoob

🏠
Working from home
View GitHub Profile
@yeahnoob
yeahnoob / settings.json
Last active August 29, 2021 15:01
color schems "Gruvbox Night" and "PaperColor Light" in Window Terminal Preview
{
"schemes":
[
{
"background": "#32302F",
"black": "#32302F",
"blue": "#5CAEA8",
"brightBlack": "#75715E",
"brightBlue": "#66C2C2",
"brightCyan": "#009999",
@yeahnoob
yeahnoob / Grayscale_noobs.xml
Created November 27, 2018 07:44
a dark grayscale colorscheme(style) used in QtCreator(Qt5)
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme version="1.0" name="Grayscale_noobs">
<style name="Text" foreground="#f3f3f3" background="#2d2d2d"/>
<style name="Link" foreground="#00c1ff"/>
<style name="Selection" foreground="#f3f3f3" background="#308cc6"/>
<style name="LineNumber" foreground="#ffffff" background="#555753"/>
<style name="SearchResult" background="#544f05"/>
<style name="SearchScope" background="#2e3436"/>
<style name="Parentheses" background="#4e9a06" bold="true"/>
<style name="ParenthesesMismatch" background="#808080"/>
@yeahnoob
yeahnoob / index.html
Last active January 2, 2017 10:59
d3.js Tree: most simple sample
<!DOCTYPE html>
<html>
<head>
<title>Simple Tree Demo</title>
<script type="text/javascript" src="//d3js.org/d3.v3.min.js"></script>
<style>
.link {
fill: none;
stroke: #ccc;
@yeahnoob
yeahnoob / .minttyrc
Created November 4, 2016 12:26
color scheme of the mingw64 terminal, in M$ Windows
BoldAsFont=yes
Font=Consolas
FontHeight=12
FontSmoothing=full
CursorType=block
CursorBlinks=no
Columns=100
Rows=45
Locale=zh_CN
Charset=UTF-8
@yeahnoob
yeahnoob / blog_2016-10-27.md
Created October 27, 2016 09:46
修正Ubuntu 16.04 LTS命令行的中文字体(不影响英文字体)

修正Ubuntu 16.04 LTS命令行的中文字体(不影响英文字体)

操作系统 Ubuntu 16.04 LTS 默认的命令行终端(Terminal)里的中文字体配置是有一点问题的。

比如“门”这个中文汉字,在 Terminal 里会显示成一个现在基本用不到的古代异体字(估计是日文汉字的默认字体)。

可以整体使用中文字体,但是如果英文字体想选其他的,比如想用Source Code Pro系列,就需要找变通办法。

一个办法,是造一个混合字体,把自己想要的中文字体和英文字体手工合并一个。但是更换其中任何一个字体都不是那么灵活——每次换字体,都需要重头手工合并一次。

#!/bin/bash
# Save this script into set_colors.sh, make this file executable and run it:
#
# $ chmod +x set_colors.sh
# $ ./set_colors.sh
#
# Alternatively copy lines below directly into your shell.
gconftool-2 --set /apps/gnome-terminal/profiles/Default/use_theme_background --type bool false
@yeahnoob
yeahnoob / arrays_ds.rs
Created May 4, 2016 13:11
Arrays - DS
// Enter your code here
use std::io;
fn main() {
let mut in_line_1 = String::new();
let mut in_line_2 = String::new();
io::stdin().read_line(&mut in_line_1).ok().expect("Line 1 read error");
io::stdin().read_line(&mut in_line_2).ok().expect("Line 2 read error");
let n: usize = in_line_1.trim().parse().ok().expect("Parse Error");
@yeahnoob
yeahnoob / netstat.go
Last active March 30, 2016 02:53
retrieve `netstat.exe` command result in WIN32 system
/// Get the STY Water Supply Department's IP address
package main
import (
"bytes"
"fmt"
"log"
"os/exec"
"regexp"
)
@yeahnoob
yeahnoob / wordpairs-opt.jl
Created December 2, 2014 15:06
wordpairs optimization use custom hash index
### Commentary:
### With JuliaLang v0.3.3
# English words' Hash Function borrowed from http://www.cse.yorku.ca/~oz/hash.html
function hashdjb2(t::String)
### used for english words' hash
## ha = convert(Uint,5381)
ha = 0x0000000000001505
for c in t
@yeahnoob
yeahnoob / ping.pl
Last active May 1, 2019 01:37
Ping & Log
#!/usr/bin/perl
use Net::Ping;
use Time::HiRes;
$host = $ARGV[0];
while (1) {
open $fd, '>>:encoding(UTF-8)', 'ping.pl.log';
$p = Net::Ping->new("icmp");
$p->hires();
($ret, $duration, $ip) = $p->ping($host, 2); #config ping timeout=2sec.
print $fd scalar(localtime);