Skip to content

Instantly share code, notes, and snippets.

View farseerfc's full-sized avatar
👶
rsync -a my-knowledge my_baby_girl:~/

Jiachen Yang farseerfc

👶
rsync -a my-knowledge my_baby_girl:~/
View GitHub Profile
@farseerfc
farseerfc / try.desktop
Created July 27, 2020 03:06
try plasma remove shadow
[Desktop Entry]
Categories=System;Utility;
Comment[zh_CN]=
Comment=
Exec=/home/farseerfc/try.sh
GenericName[zh_CN]=try
GenericName=try
MimeType=
Name[zh_CN]=try
Name=try
+ rm -rf testimage testmount
+ mkdir testmount
+ fallocate -l 1G testimage
+ mkfs.ext4 testimage
mke2fs 1.45.6 (20-Mar-2020)
Discarding device blocks: 4096/262144 done
Creating filesystem with 262144 4k blocks and 65536 inodes
Filesystem UUID: f4746471-fb36-4a46-8b05-258557c24a0c
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
@farseerfc
farseerfc / gen-make-dag.sh
Created November 20, 2019 06:56
generate make-dag.svg for Makefile using makefile2graph
#!/bin/bash
set -x
# first invoke make to get a log of dependencies
LANG=C make -Bnd > make-dag.log
# run makefile2graph
cat make-dag.log | makefile2graph > make-dag.dot
sed "1a ranksep=5; nodesep=5;" -i make-dag.dot
twopi -Tsvg make-dag.dot -o make-dag.svg
@farseerfc
farseerfc / prime_spirals.py
Created July 29, 2019 08:03
Generating prime spirals as described on numberphile https://www.youtube.com/watch?v=iFuR97YcSLM
from matplotlib import pyplot as plt
from functools import lru_cache
SIEVE = 1000
@lru_cache()
def sieve(limit):
factors = [2] * limit
for base in range(2, int(limit**0.5 + 1)):
# if factors[base] == 2:
all: main libb.so.1.0 liba.so.1.0
libb.so.1.0: b.c
gcc --shared -Wl,-soname,libb.so.1 -o libb.so.1.0 b.c
ln -sr libb.so.1.0 libb.so.1
liba.so.1.0: a.c
gcc --shared -Wl,-soname,liba.so.1 -o liba.so.1.0 a.c
ln -sr liba.so.1.0 liba.so.1
@farseerfc
farseerfc / archlinux_cn_talks.md
Last active October 12, 2023 14:00 — forked from KenOokamiHoro/archlinux_cn_talks.md
Arch Linux CN Community talk group guides
@farseerfc
farseerfc / pre-push.sh
Last active October 31, 2017 19:22
.git/hooks/pre-push to check version matches tag name
#!/bin/bash
## hook to check ver match tag before push
VERSIONFILE="gitversion.h"
tagref=$(grep -Po 'refs/tags/([^ ]*) ' </dev/stdin | head -n1 | cut -c11- | tr -d '[:space:]')
if [[ "$tagref" == "" ]]; then
## pushing without --tags , exit normally
exit 0
[package]
name = "rustqt"
build = "build.rs"
version = "0.1.0"
authors = ["Jiachen Yang <farseerfc@gmail.com>"]
[dependencies]
[dependencies.rustcxx_plugin]
git = "https://github.com/google/rustcxx.git"

Keybase proof

I hereby claim:

  • I am farseerfc on github.
  • I am farseerfc (https://keybase.io/farseerfc) on keybase.
  • I have a public key ASAfsBGLbRZcnLDyBAkAxdrJh48z-JYrzvcV2HH6T2y6kQo

To claim this, I am signing this object:

@farseerfc
farseerfc / PKGBUILD
Last active February 24, 2016 16:39
PKGBUILD for powerline to merge python-powerline and python2-powerline
# Maintainer: Jiachen Yang <farseerfc@gmail.com>
# AUR Maintainer: Swift Geek
# AUR Maintainer: Timothée Ravier <tim@siosm.fr>
# AUR Maintainer: Stefan Tatschner <rumpelsepp@sevenbyte.org>
# Contributor: Swift Geek
# Contributor: Pablo Olmos de Aguilera C. pablo+aur at odac dot co
_pkgname="powerline"
pkgbase="powerline"
pkgname=("powerline" "powerline2" "python-powerline" "python2-powerline" "powerline-common" "powerline-vim" "powerline-fonts")