Skip to content

Instantly share code, notes, and snippets.

View peterfriese's full-sized avatar
🔥

Peter Friese peterfriese

🔥
View GitHub Profile
@disc0infern0
disc0infern0 / ReminderList
Created November 4, 2021 12:17
a Reminder List with control of focus, adding new values with double click, auto deleting nil values, using Combine for delay
//
// ReminderList.swift
//
// Demonstrates:-
// list settings (style, colouring etc )
// autoscrolling
// control of focus in List,
// adding new values with enter, or double click,
// auto deleting nil values,
// using Combine for managed delay/UI updates
//
// DismissableView.swift
//
// Created by Andrew Jackson on 05/09/2020.
//
import SwiftUI
struct DismissableView<Content: View>: View {
@julesjans
julesjans / screen-gif.sh
Last active May 8, 2021 16:40
Capture iOS Simulator to animated gif
# Turn on the simulator screen capture
xcrun simctl io booted recordVideo ~/simulator.mov
# Convert the iPhone 6s screen shot into a gif:
ffmpeg -i ~/simulator.mov -vf scale=320:-1 -r 6 -f gif -y simulator.gif
@danieleggert
danieleggert / GPG and git on macOS.md
Last active May 3, 2024 12:26
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@parmentf
parmentf / GitCommitEmoji.md
Last active May 6, 2024 18:30
Git Commit message Emoji
@shakalaca
shakalaca / gist:4942cfb8a4869325cdc9
Last active November 6, 2019 07:29
Howto: compile mkbootimg/mkbootfs/make_ext4fs on OS X
mkdir source
mkdir bin
# clone source
cd source
git clone --branch android-4.3_r3 https://android.googlesource.com/platform/external/libselinux
git clone --branch android-4.3_r3 https://android.googlesource.com/platform/system/core
git clone --branch android-4.3_r3 https://android.googlesource.com/platform/external/zlib
git clone --branch android-4.3_r3 https://android.googlesource.com/platform/system/extras
@mjohnsullivan
mjohnsullivan / MainActivity.java
Last active March 1, 2024 01:28
Android Wear activity that reads and displays sensor data from the device
package com.example.wear;
import android.app.Activity;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.wearable.view.WatchViewStub;
import android.util.Log;
@wearhere
wearhere / shell.swift
Last active March 5, 2021 01:29
Shell scripting in Swift, using a proper hashbang and a custom subshell operator.
#!/usr/bin/xcrun swift -i -sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
//
// shell.swift
//
// Shell scripting in Swift, using a proper hashbang and a custom subshell operator.
// To run: `chmod +x shell.swift && ./shell.swift`.
//
// If you edit this in Xcode, ignore the error on the hashbang line.
// To play around with this in a playground, comment out the hashbang line.
//
@JamieMason
JamieMason / unfollow.js.md
Last active April 26, 2024 19:31
Unfollow everyone on twitter.com

Unfollow everyone on twitter.com

  1. Go to https://twitter.com/YOUR_USER_NAME/following
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//