Skip to content

Instantly share code, notes, and snippets.

View xzhong86's full-sized avatar

Bruce Zhong xzhong86

  • Hisilicon
  • China
View GitHub Profile
@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 7, 2024 08:15
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@38
38 / Makefile
Last active February 19, 2024 02:12
A Minimal LLVM JIT example for LLVM-5
jit-toy: jit-toy.cpp
clang++ -g -o $@ $^ $(shell /usr/lib/llvm-5.0/bin/llvm-config --cxxflags --ldflags --system-libs --libs core)
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 2, 2024 16:19
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@owainlewis
owainlewis / Gzip.scala
Last active June 21, 2023 05:30
Gzip Scala
import java.io.{ByteArrayOutputStream, ByteArrayInputStream}
import java.util.zip.{GZIPOutputStream, GZIPInputStream}
import scala.util.Try
object Gzip {
def compress(input: Array[Byte]): Array[Byte] = {
val bos = new ByteArrayOutputStream(input.length)
val gzip = new GZIPOutputStream(bos)
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 18, 2024 18:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@mayfer
mayfer / actions.rb
Created April 23, 2015 18:34
Sinatra login/logout
# Homepage (Root path)
enable :sessions
helpers do
def current_user
begin
@current_user = User.find(session["user_id"].to_i)
# @current_user = User.find(response.cookies["user_id"].to_i)
rescue
@current_user = nil
package eval
import scala.reflect.runtime.currentMirror
import scala.tools.reflect.ToolBox
import java.io.File
object Eval {
def apply[A](string: String): A = {
val toolbox = currentMirror.mkToolBox()
@mahata
mahata / eshell-path-env.el
Created September 15, 2012 19:47
eshell-path-env and PATH
(defun eshell-mode-hook-func ()
(setq eshell-path-env (concat "/usr/local/bin:" eshell-path-env))
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))
(define-key eshell-mode-map (kbd "M-s") 'other-window-or-split))
(add-hook 'eshell-mode-hook 'eshell-mode-hook-func)
@suruseas
suruseas / server.rb
Last active June 26, 2023 07:47
Sinatra(WEBrick)でsslサーバをたてる
# -*- coding: utf-8 -*-
require 'sinatra/base'
require 'pp'
require 'webrick'
require 'webrick/https'
require 'openssl'
CRT_FILE_NAME = 'server.crt'
RSA_FILE_NAME = 'server.key'
@ngauthier
ngauthier / Gemfile
Created March 23, 2012 16:42
Demo Sinatra App
source :rubygems
gem 'sinatra'