Skip to content

Instantly share code, notes, and snippets.

View piemonte's full-sized avatar

patrick piemonte piemonte

View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active May 10, 2024 17:04
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@Anteloper
Anteloper / iMessage-bot-on-beeper.md
Last active May 1, 2024 12:31
Running an iMessage Bot on EC2 Using Beeper

Requirements:

  • Be a Beeper user
  • Python > 3.7
  • Docker
  • yarn

1. Getting a Maubot running

  1. following these steps I ran the docker container to create a Maubot server on my local machine
  2. an unspoken but relevant step here is to create a user that you’ll log into your Maubot Manager interface with. do this line 86 of config.yaml. For example
/**
* Render CyberBrokers
* Using the on-chain Broker renderer
**/
// Change these variables as you see fit
const WEB3_PROVIDER_URL = "http://0.0.0.0:8545";
const TOKEN_ID = 0;
const SVG_SAVE_FILE_NAME = `${__dirname}/CyberBroker_${TOKEN_ID}.svg`;
@xtremetom
xtremetom / randomTokenSelector.sol
Last active February 27, 2023 22:56
randomTokenSelector Untested
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
This code is untested, feel free to use it, but do so at your own risk
*/
contract Random {
uint256[] tokens = new uint256[](100);
@0xOlias
0xOlias / tiny-83-mint-helper.md
Last active November 2, 2021 00:26
TINY-83 mint helper
  1. Go to https://tiny-83.github.io/tiny-83
  2. Change the min and max fields as shown below:
xMin = 0
xMax = 22
yMin = -1
yMax = 14
  1. Copy this code, type 1 where you want to draw a pixel, then paste the result into the y = text field on the website.
@dievardump
dievardump / README.md
Last active January 25, 2023 14:55
Base file I used to use for my mainnet contracts to be compatible with OpenSea

Warning !!!

Recent events have shown that the auto-approval for user proxies is way too dangerous.

Security of users' NFTs should come before the convenience of auto approving collection for trading.

This is why I decided to remove the files in this gist.

Security risk

@Sytten
Sytten / Dockerfile
Last active October 21, 2021 01:19
Dockerfile for Typescript, Prisma2 and lerna
### BASE ###
FROM node:12-buster-slim AS base
RUN apt-get update && apt-get install --no-install-recommends --yes openssl
WORKDIR /app
### BUILDER ###
FROM base AS builder
import UIKit
struct Action {
let title: String
let style: UIAlertAction.Style
let action: () -> Void
}
extension Action {
static func `default`(_ title: String, action: @escaping () -> Void) -> [Action] {
@elaughli
elaughli / obj2usdz.mm
Created December 12, 2018 22:33
function to convert a saved obj file to USDZ in objective-c
// path to documents directory to save our usdc file
NSString* usdcPath = [documentsDirectory stringByAppendingPathComponent:@"usdcExample.usdc"];
NSURL *usdcUrl = [NSURL fileURLWithPath: usdcPath];
// path to documents directory to save our final usdz file
NSString* usdzPath = [documentsDirectory stringByAppendingPathComponent:@"usdzExample.usdz"];
NSURL *usdzUrl = [NSURL fileURLWithPath:usdzPath];
// load the .obj file at filePath as an MDLAsset
NSURL *url = [NSURL fileURLWithPath:filePath];
@domhofmann
domhofmann / onono.md
Last active August 23, 2020 11:59
onono

Onavo Protect is a free and popular VPN owned by Facebook.

Facebook ostensibly uses Onavo to monitor user network traffic, specifically to gain insight into what is and isn't working in competing apps. That kind of sucks if you're building a consumer app and aren't planning on selling it to Facebook.

Detecting if the people who use your app are also using Onavo and encouraging them to disable it might be helpful to you.

Here is some Swift code that does that:

func checkForBadIP (_ ip: String) -> Bool {