Skip to content

Instantly share code, notes, and snippets.

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

Jiezhe Wang wangjiezhe

🏠
Working from home
View GitHub Profile
# LaTeX Files
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
*.alg
@kasuganosora
kasuganosora / SSWatchdog
Created November 24, 2013 04:18
Shadowsocks Watchdog 监视Shadowsocks是否正常运行 如果不正常的话就 杀掉原来的进程重新启动Shadowsocks
import socket
import threading
import os
import subprocess
Port = 123 #Shadowsocks 的端口
ShadowsocksPath = "/home/ss" #Shadowsocks 的路径
def CheckService():
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@reorx
reorx / encoding_converter.py
Created April 4, 2012 05:21
char detect & convert
#!/usr/bin/python
# -*- coding: utf-8 -*-
import chardet
BROTHER_ENCODINGS = [
('GB2312', 'GBK', 'GB18030'),
]
@m13253
m13253 / convert_xv_flv.c
Last active December 10, 2016 14:08
Convert Xunlei XV media file to FLV media file. Origin: http://hi.baidu.com/naylonslain/item/9586125a9f5979dbd58bac47
#include <stdio.h>
#include <stdlib.h>
int convert_file(char *szSourceFile, int bIsFastConv)
{
char szNewFileName[256] = {0};
int buffer[0x400];
int i;
char flag;
char data;
@joshuamiller
joshuamiller / flavor.rb
Last active March 23, 2017 22:35 — forked from ttscoff/flavor.rb
#!/usr/bin/ruby
# encoding: US-ASCII
# Convert a Markdown README to HTML with Github Flavored Markdown
# Github and Pygments styles are included in the output
#
# Requirements: json gem (`gem install json`)
#
# Input: STDIN or filename
# Output: STDOUT
# Arguments: "-c" to copy to clipboard (or "| pbcopy"), or "> filename.html" to output to a file
@tvvocold
tvvocold / slides.fdzh.org - 在云端的泡泡糖
Last active May 5, 2017 15:49
slides.fdzh.org-请自定义文件名
<section data-background-transition='zoom' data-transition='concave' data-background='http://fdorg.qiniudn.com/galaxy-10996_1280.jpg' data-state='blackout'>
<h1>在云端的泡泡糖</h1>
<h4>slides.fdzh.org</h4>
<p>请按 空格 或点击 右下角方向键 继续演示...</p>
</section>
<section data-background-transition='zoom' data-transition='linear'>
<h2>如何使用?</h2>
<p>仅需 Fork 一份 Gist </p>
<a href='https://gist.github.com/tvvocold/30e2848f2ba2a294ab28'>https://gist.github.com/tvvocold/30e2848f2ba2a294ab28</a></p>
@paulosuzart
paulosuzart / guess-client.rkt
Last active April 19, 2018 08:22
Guess game - two processes (racket)
#lang racket
(require racket/serialize)
(require racket/cmdline)
(require "./messages.rkt")
(define (rand-number pred ran)
(let loop ()
(let ([r (random ran)])
(if (pred r) (loop) r))))
@tfmoraes
tfmoraes / 01_vtkCxxRevisionMacro.patch
Last active July 9, 2019 20:47
Patches to Compile gdcm with VTK6 and VTK7
diff --git a/Utilities/VTK/Applications/gdcmviewer.cxx b/Utilities/VTK/Applications/gdcmviewer.cxx
index 57facd6..a74c1f5 100644
--- a/Utilities/VTK/Applications/gdcmviewer.cxx
+++ b/Utilities/VTK/Applications/gdcmviewer.cxx
@@ -118,7 +118,7 @@ public:
double GetOverlayVisibility() { return 0; }
void SetOverlayVisibility(double vis) {(void)vis;}
};
-vtkCxxRevisionMacro(vtkGDCMImageViewer, "$Revision: 1.30 $")
+//vtkCxxRevisionMacro(vtkGDCMImageViewer, "$Revision: 1.30 $")
#lang racket
(require net/http-client)
(require net/url)
(require json)
(require net/uri-codec)
(require racket/cmdline)
(define lg (make-logger 'currency-logger))
(current-logger lg)
F#C#ScalaClojurePythonRubyHaskellSQLOCamlCommon LispErlangSmalltalkSchemeEcmascript 5Perl 5
mapSelectmapmapmapcollectmapSelectmapmapcarmapcollect:mapmapmap
filterWherefilterfilterfilterselectfilterWherefilterremove-if-notfilterselect:filterfiltergrep
foldAggregatefoldLeftreducereduceinjectfoldl