Skip to content

Instantly share code, notes, and snippets.

View htfy96's full-sized avatar
🐢
WFH

Zheng Luo htfy96

🐢
WFH
View GitHub Profile
@wenLiangcan
wenLiangcan / PKGBUILD
Last active January 31, 2016 15:37
Arch Linux packaging scripts for timxx/xmradio
# Maintainer: Vic Luo <vicluo96@gmail.com>
pkgname=xmradio-git
pkgver=0.5.1.14.ga5187cc
pkgrel=1
pkgdesc="xmradio is a tiny Internet Xia Mi Radio client for Linux, which supports many radio style, skin builtin and many other features."
arch=('x86_64' 'i686')
url="https://github.com/timxx/xmradio"
license=('GPL3')
depends=('dbus' 'vlc')
template
void Unite2D(const Rectangle& other, bool allowEmpty = false)
{
static_assert(sizeof...(Components) >= sizeof...(RhsComponents), "Cannot assign to type with less components than operand!");
static_assert(meta_contains_types<meta_packer, meta_packer>::value, "Operand has components that are not part of this object!");
m_Value.Unite2D(other.m_Value, allowEmpty);
}
@nucular
nucular / _
Last active September 24, 2017 01:32
-Osuperfast
export CFLAGS=""\
"-march=native -Ofast"\
"-fmerge-all-constants"\
"-fmodulo-sched -fmodulo-sched-allow-regmoves"\
"-fgcse-sm -fgcse-las -fgcse-after-reload"\
"-funsafe-loop-optimizations"\
"-fdevirtualize-speculatively -fdevirtualize-at-ltrans"\
"-fipa-pta"\
"-ftree-loop-if-convert-stores -ftree-loop-distribution -ftree-loop-im"\
"-ftree-parallelize-loops=$(nproc)"\
@wilzbach
wilzbach / main.d
Last active July 24, 2018 16:24
C++ Munich Meetup - D without a runtime
int foo(int a, int b)
{
return (a % 3235272) % b;
}
int bar(int a)
{
return foo(a, 88);
}
@raskasa
raskasa / utility-functions.prolog
Created December 14, 2012 03:23
All useful Prolog functions learned over the course of the semester in CS 341 - Programming Languages.
% Contained within are all the useful Prolog functions learned in CS 341 this past semester (Fall 2012).
% NOTE: Any functions used that are not defined in this file are built-in functions.
% length(+As,-N)
% returns in N the length of the list As
length([],0).
length([A|As],N) :- length(As,M), N is M+1.
% append(+As,+Bs,-Cs)
% returns in Cs the append of lists As and Bs
#define __forceinline inline
#include <iostream>
#include <embree2/rtcore.h>
#include <embree2/rtcore_ray.h>
// yuck. Required by Embree.
#include <xmmintrin.h>
#include <pmmintrin.h>
@obihann
obihann / .nethackrc
Last active November 21, 2020 17:03
NetHack Config
OPTIONS=showexp,showscore,time,color,!autopickup,pickup_burden:unencumbered
OPTIONS=pickup_types:$?!/(+
OPTIONS=autodig,fruit:slime mold,boulder:0
OPTIONS=number_pad:2
OPTIONS=suppress_alert:3.4.3
MSGTYPE=hide "You displaced *." # pet displacement
OPTIONS=statuscolors
STATUSCOLOR=hp%100=green,hp%66=yellow,hp%50=orange
@a-s-o
a-s-o / Caddyfile
Last active January 6, 2021 10:28
Single page app rewriting with Caddy server
localhost:80
gzip
ext .html
root /home/deploy/current/build/www
proxy /graphql localhost:3000
rewrite /login {
to {path} /login
}
@mgedmin
mgedmin / strace_process_tree.py
Last active January 13, 2021 15:02
Tool to help me make sense out of `strace -f` output.
in/python
# -*- coding: UTF-8 -*-
"""
Usage:
strace-process-tree filename
Read strace -f output and produce a process tree.
Recommended strace options for best results:
@SaveTheRbtz
SaveTheRbtz / set_qdisc.sh
Last active January 8, 2022 17:45
mq+fq
#!/bin/bash -ue
# Sets up mq+$shed combo for given interface.
if [ $# -ne 2 ] || [ -z "$1" ] || [ -z "$2" ]; then
echo "usage: $0 interface scheduler" >&2
echo " e.g: $0 eth0 fq" >&2
echo " e.g: $0 eth0 pfifo_fast" >&2
exit 64 # EX_USAGE
fi