Skip to content

Instantly share code, notes, and snippets.

@trungnguyen1791
trungnguyen1791 / trilateration.js
Created March 12, 2019 03:54 — forked from kdzwinel/trilateration.js
Simple trilateration algorithm implementation in JavaScript.
function getTrilateration(position1, position2, position3) {
var xa = position1.x;
var ya = position1.y;
var xb = position2.x;
var yb = position2.y;
var xc = position3.x;
var yc = position3.y;
var ra = position1.distance;
var rb = position2.distance;
var rc = position3.distance;
@trungnguyen1791
trungnguyen1791 / kernel_task_cpu_fix
Created September 25, 2018 06:07
Fix kernel_task high CPU usage on OS X
# Boot to recovery mode and disable system integrity protection
csrutil disable
# Reboot to regular mode and purge these motherfuckin plists
sudo rm -f /System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext/Contents/Resources/*.plist
# Reboot to recovery mode and enable system integrity protection
csrutil enable
# Reboot
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@trungnguyen1791
trungnguyen1791 / BeaconResearch.md
Created February 6, 2018 16:23
iBeacon / Beacon Research
@trungnguyen1791
trungnguyen1791 / UILabel with Countdown
Created February 18, 2017 19:36 — forked from dokun1/UILabel with Countdown
UILabel as countdown timer given NSTimeInterval
-(void) updateCountdown {
NSTimeInterval timeToClosing = [_deleteDate timeIntervalSinceDate:[NSDate date]];
div_t h = div(timeToClosing, 3600);
int hours = h.quot;
div_t m = div(h.rem, 60);
int minutes = m.quot;
int seconds = m.rem;
NSString *hoursStr, *minutesStr, *secondsStr;