This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
METHOD 1 | |
This should roughly sort the items on distance in MySQL, and should work in SQLite. | |
If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance. | |
--- | |
SELECT * | |
FROM table | |
ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/busybox sh | |
# 1) Download a prebuilt BusyBox binary here: | |
# https://busybox.net/downloads/binaries/ | |
# | |
# 2) Prepare your kernel | |
# cp /boot/vmlinuz vmlinuz | |
# | |
# 3) Copy the files | |
# install -Dm0755 busybox-x86_64 initramfs/bin/busybox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
my $dev = "/sys/class/leds/led0/brightness"; | |
my $OFF = "1"; | |
my $ON = "0"; | |
my ($ip) = `ifconfig`=~/ddr:(.*?) /; | |
#print $ip; | |
# Strip out the .'s | |
$ip =~ s/\.//g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -e | |
# origin-source: http://www.fars-robotics.net/install-wifi | |
# install-wifi - v9.4 - by MrEngman. | |
# After downloading this script: | |
# $ sudo mv ./install-wifi /usr/bin/install-wifi | |
# $ sudo chmod +x /usr/bin/install-wifi | |
# $ sudo install-wifi -h | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Animate the Lines WebGL experiment automatically | |
// @namespace https://gist.github.com/spite/90e3dbf8e117660f6788a5748ae06cad | |
// @version 0.2 | |
// @description Automatically drags the mouse, leading to a pleasant effect | |
// @author spite, userscripted by Piskvor | |
// @match https://lines.chromeexperiments.com/drag/ | |
// @grant none | |
// @updateURL https://gist.github.com/Piskvor/41df1f68b44b43100552126c76e2f609/raw/experiments_lines_drag.user.js | |
// ==/UserScript== |