Skip to content

Instantly share code, notes, and snippets.

@yenliangl
yenliangl / Font smoothing settings in Snow Leopard
Last active September 5, 2015 22:25
Tune font smoothing of Snow Leopard in command line
# Open Terminal and enter,
# Replace 2 with a number between 0 and 3.
# 0: Light
# 1: Standard
# 2: Medium
# 3: Bold
defaults -currentHost write -globalDomain AppleFontSmoothing -int 2
@fmela
fmela / stacktrace.cxx
Last active September 22, 2023 10:58
A C++ function that produces a stack backtrace with demangled function & method names.
/*
* Copyright (c) 2009-2017, Farooq Mela
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
@yenliangl
yenliangl / PerfectNumberFinder.java
Created September 4, 2011 13:08
Perfect number finder
public class PerfectNumberFinder {
public static boolean isPerect(int number) {
// get factors
List<Integer> factors = new ArrayList<Integer>();
factors.add(1);
factors.add(number);
for (int i = 2; i < Matj.sqrt(number); i++) {
if (number % i == 0) {
factors.add(i);
if (number / i != i) {
@gabrielemariotti
gabrielemariotti / build.gradle
Last active January 12, 2024 17:41
Use signing.properties file which controls which keystore to use to sign the APK with gradle.
android {
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}