Skip to content

Instantly share code, notes, and snippets.

View htfy96's full-sized avatar
🐢
WFH

Zheng Luo htfy96

🐢
WFH
View GitHub Profile
@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)"\
@csukuangfj
csukuangfj / default-linker-script.txt
Last active May 7, 2024 04:19
This file shows the default linker script of `ld`, use `ld --verbose` to show it.
GNU ld (GNU Binutils for Ubuntu) 2.25.1
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
i386pep
i386pe
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);
}
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
#define __forceinline inline
#include <iostream>
#include <embree2/rtcore.h>
#include <embree2/rtcore_ray.h>
// yuck. Required by Embree.
#include <xmmintrin.h>
#include <pmmintrin.h>
@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
}
@apla
apla / build-chromium-windows.bat
Last active May 9, 2023 15:00
Build CEF# from source with mp4
@echo off
REM instructions from: https://groups.google.com/d/msg/cefsharp/BJLMXl9c204/HMJlp8mZzF0J
REM seems like partial instructions copied to SO: http://stackoverflow.com/questions/8033495/chromium-embedded-framework-mp3-support
REM all chromium releases: https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding.md#markdown-header-release-branches
REM 2272 - latest chromium with npapi (41)
REM there is a commits list: https://bitbucket.org/chromiumembedded/cef/branch/2272
REM https://github.com/cefsharp/CefSharp
REM cef builds http://www.magpcss.net/cef_downloads/
REM https://cefbuilds.com
@vasanthk
vasanthk / System Design.md
Last active May 6, 2024 20:21
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@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')
@Dufgui
Dufgui / gist:72debe81068bf3ecd7d8
Last active April 25, 2023 14:34 — forked from eduardocardoso/gist:82a629882ddb02ab3677
Script to delete exited containers and untagged/unused images from docker
#!/bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
echo "Removing dangling images..."
docker images --no-trunc -q -f dangling=true | xargs -r docker rmi