Skip to content

Instantly share code, notes, and snippets.

@qwazer
qwazer / github-markdown-print.js
Created October 12, 2018 14:31 — forked from hangxingliu/github-markdown-print.js
GitHub Markdown Print Script
// Refrence from: https://gist.github.com/beevelop/a0f2c76e79610dca01550c9a93f83876
// Copy following scripts in the developer console of page included markdown content you want to print:
(function () {
var $ = document.querySelector.bind(document);
$('#readme').setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white');
$('#readme>article').setAttribute('style', 'border: none');
$('body').innerHTML = $('#readme').outerHTML;
window.print();
})();
@qwazer
qwazer / introrx.md
Created October 11, 2018 17:10 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@qwazer
qwazer / postgres-cheatsheet.md
Created September 13, 2018 12:07 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
The main thing to watch out for is that Flyway requires a linear versioning to the files, so if two developers check in migrations at the same time, one of them will have to rename theirs.
https://github.com/flyway/flyway/issues/607
https://github.com/flyway/flyway/issues/404
@qwazer
qwazer / without_turbo_boost
Created October 28, 2014 18:07
without_turbo_boost + cpu info
jmh@debian:~/jmh/jmh-samples$ java -jar target/benchmarks.jar JMHSample_03 -wi 5 -i 5 -t 4 -f 1
# VM invoker: /usr/lib/jvm/java-8-oracle/jre/bin/java
# VM options: <none>
# Warmup: 5 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 4 threads, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: org.openjdk.jmh.samples.JMHSample_03_States.measureShared
@qwazer
qwazer / without_turbo_boost
Created October 28, 2014 18:06
without_turbo_boost
jmh@debian:~/jmh/jmh-samples$ java -jar target/benchmarks.jar JMHSample_03 -wi 5 -i 5 -t 4 -f 1
# VM invoker: /usr/lib/jvm/java-8-oracle/jre/bin/java
# VM options: <none>
# Warmup: 5 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 4 threads, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: org.openjdk.jmh.samples.JMHSample_03_States.measureShared
@qwazer
qwazer / fontfix.patch
Created October 18, 2013 19:26 — forked from aleksandara/fontfix.patch
OpenJDK 7 font rendering patch for Linux (cd openjdk/jdk; patch -p1 < fontfix.patch)
diff -r 96a023de3ddf make/sun/font/Makefile
--- a/make/sun/font/Makefile Wed Jun 06 18:39:46 2012 -0700
+++ b/make/sun/font/Makefile Fri Jun 08 12:52:01 2012 +0900
@@ -128,7 +128,7 @@
ifeq ($(USING_SYSTEM_FT_LIB), false)
FREETYPE_LIB = $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX).6
endif
- OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) -lfreetype
+ OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) -lfreetype -lfontconfig
endif
@qwazer
qwazer / gist:5510772
Created May 3, 2013 16:32
Error log CS:S
Running Steam on ubuntu 12.04 32-bit
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(1367538058_client)
Installing breakpad exception handler for appid(steam)/version(1367538058_client)
unlinked 0 orphaned pipes
GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
Installing breakpad exception handler for appid(steam)/version(1367538058_client)
[0503/201910:WARNING:proxy_service.cc(646)] PAC support disabled because there is no system implementation
Installing breakpad exception handler for appid(steam)/version(1367538058_client)
Installing breakpad exception handler for appid(steam)/version(1367538058_client)
@qwazer
qwazer / gist:5510743
Created May 3, 2013 16:30
system info steam
Processor Information:
Vendor: GenuineIntel
Speed: 2400 Mhz
1 logical processor
0 physical processor
HyperThreading: Supported
FCMOV: Supported
SSE2: Supported
SSE3: Supported
SSSE3: Unsupported