Skip to content

Instantly share code, notes, and snippets.

View adam-weber's full-sized avatar
🛴
Scootering

Adam Weber adam-weber

🛴
Scootering
View GitHub Profile
@gangstead
gangstead / forscan_wine.md
Last active February 14, 2025 02:19
Forscan on MacOS Montery with wine/wineskin

FORscan is windows only software. You want to run on a Mac. You can download a big windows VirtualBox image (20 GB), run Boot camp, or pay for something like Parallels ($80) or CrossOver ($60, built on Wine).

Instead you can pay with your time and try to get wine running. Problem: wine development for MacOS seems to have died with Catalina (10.15) dropped any support for 32 bit applications. Also every wine setup tutorial you find for a Mac is tightly coupled to the exact version of Mac/Wine/direction of the wind/ shoe size of the author on the day the tutorial was made and will not work for you. With that said here's what it took for me:

Wineskin. Kegworks

Edit 2/13/25 Wineskin appears to have been renamed to Kegowrks

brew install --cask --no-quarantine gcenx/wine/kegworks
@justinmklam
justinmklam / flask-port80-without-sudo.md
Last active June 21, 2024 19:59
Run a flask app on port 80 without sudo.

Flask apps are bound to port 5000 by default. To bind it to port 80, you would need to change the port as follows:

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80, debug=True)

And to run it:

@lukicdarkoo
lukicdarkoo / configure.sh
Last active February 15, 2025 02:28
Raspberry Pi: AP + client mode
#!/bin/sh
# The script configures simultaneous AP and Managed Mode Wifi on Raspberry Pi Zero W (should also work on Raspberry Pi 3)
# Usage: curl https://gist.githubusercontent.com/lukicdarkoo/6b92d182d37d0a10400060d8344f86e4/raw | sh -s WifiSSID WifiPass APSSID APPass
# Licence: GPLv3
# Author: Darko Lukic <[email protected]>
# Special thanks to: https://albeec13.github.io/2017/09/26/raspberry-pi-zero-w-simultaneous-ap-and-managed-mode-wifi/
MAC_ADDRESS="$(cat /sys/class/net/wlan0/address)"
CLIENT_SSID="${1}"
CLIENT_PASSPHRASE="${2}"
@hubgit
hubgit / PrivateRoute.js
Last active November 28, 2018 04:20
PrivateRoute for React Router v4
import React from 'react'
import { connect } from 'react-redux'
import { Redirect, Route, withRouter } from 'react-router-dom'
import { fetchUser } from './actions'
const PrivateRoute = ({ user, fetchUser, component, ...rest }) => (
<Route {...rest} render={props => {
if (!user.complete) {
if (!user.fetching) {
fetchUser()

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@rveciana
rveciana / .block
Last active May 7, 2020 17:58
raster-marching-squares and leaflet
license: mit
@citrusui
citrusui / dropdown.md
Last active April 23, 2025 04:21
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@johnny77221
johnny77221 / openBLESetting
Created October 24, 2016 07:07
opening iOS BLE setting from app
NSURL *bluetoothURLOS8 = [NSURL URLWithString:@"prefs:root=General&path=Bluetooth"];
NSURL *bluetoothURLOS9 = [NSURL URLWithString:@"prefs:root=Bluetooth"];
NSURL *bluetoothURLOS10 = [NSURL URLWithString:@"Prefs:root=Bluetooth"];
if ([[[UIDevice currentDevice] systemVersion] intValue] >= 10) {
Class<NSObject> workSpaceClass = NSClassFromString(@"LSApplicationWorkspace");
if (workSpaceClass) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
id workSpaceInstance = [workSpaceClass performSelector:NSSelectorFromString(@"defaultWorkspace")];
SEL selector = NSSelectorFromString(@"openSensitiveURL:withOptions:");
@eyecatchup
eyecatchup / mr.robot_season-2_easter-egg-sites.md
Last active April 4, 2024 10:39
A collection of "Mr. Robot" Season 2 Easter Egg Sites. #mrrobot #hackingrobot #robotegg
@guisehn
guisehn / gist:6648c8fdcd1102a22a22
Last active June 2, 2021 11:08 — forked from wrburgess/gist:5528649
Backup Heroku Postgres database and restore to local database

Grab new backup

Command: heroku pg:backups capture -a [app_name]

Download

Command: curl -o latest.dump `heroku pg:backups public-url -a [app_name]`

Restore backup dump into local db