Skip to content

Instantly share code, notes, and snippets.

View ankon's full-sized avatar

Andreas Kohn ankon

View GitHub Profile
@robonxt
robonxt / Installing the Pebble app on iOS with Sideloadly.md
Last active May 21, 2024 22:09
Installing the Pebble app on iOS with Sideloadly - Rebble (Now)Official Installation Guide by robonxt

NOTICE:

This guide is now in maintenance mode. Rebble made their own official guide based on this, so please follow the updated guide on their website at help.rebble.io/sideload-ios-app. If you have any suggestions, ping me (@robonxt) or one of the helpful people in the official Rebble Discord Server and hopefully there will be a guide update soon!

Thank you for all the support, and long live Pebble and Rebble!

Fun Fact: I've never daily driven Pebble on iOS before, only to test out sideloading and to ensure the guide works with the iOS devices I have 🤣

Installing the Pebble app on iOS with Sideloadly

@zachboyd
zachboyd / AWSSubscriptionClient.ts
Last active September 22, 2022 15:09
Appsync Subscription support for subscriptions-transport-ws
import { uniqBy } from 'lodash';
import { ClientOptions, SubscriptionClient } from 'subscriptions-transport-ws';
export class AWSSubscriptionClient extends SubscriptionClient {
constructor(
url: string,
options?: ClientOptions,
webSocketImpl?: any,
webSocketProtocols?: string | string[]
) {
@prumand
prumand / prepend-empty-lines.js
Created February 28, 2020 11:54
Prepend empty lines to existing source-map
#!/usr/bin/env node
const sourceMap = require('source-map')
const fs = require('fs')
const path = require('path')
/**
* Prepend six lines to source-map
*/
const runSourceMapPrepend = async (sourceMapFile) => {
const sourceMapFileContent = fs.readFileSync(sourceMapFile, 'utf8')
@mhofman
mhofman / MacOS Screen sharing on localhost only.md
Last active May 21, 2024 22:26
MacOS ScreenSharing on localhost only

Force recent MacOS to listen for screen sharing on localhost only, keeping SIP on

All the following has been validated on MacOS Mojave 10.14.6

Problems

While there is a command line preference to accept only local VNC connections, that setting still doesn't prevent the daemon from listening to the wildcard address, and advertise the service on Bonjour. I haven't actually tried to see if it restricted anything in modern versions of the operating system, but here it is for reference:

sudo defaults write /Library/Preferences/com.apple.RemoteManagement.plist VNCOnlyLocalConnections -bool yes
@DavidDeCoding
DavidDeCoding / AwsKinesisRecordsViewer.md
Created July 19, 2017 14:38
Aws Kinesis Records Viewer

The process to view records in kinesis are as follows:

  1. Get a shard iterator:
aws kinesis get-shard-iterator --shard-id shardId-000000000000 --shard-iterator-type LATEST --stream-name
  1. Run your producer using kpl or anyother library and language.

  2. Read records of the recently created shard iterator:

@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active March 20, 2024 00:17
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,

@hediet
hediet / main.md
Last active March 11, 2024 15:05
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@BretFisher
BretFisher / docker-for-mac.md
Last active May 23, 2024 22:25
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@CaptainJiNX
CaptainJiNX / getCluster.js
Created December 21, 2016 08:55
Example of auto discovery for aws elasticache
const Memcached = require('memcached');
const configClient = new Memcached('xyz123.cfg.cache.amazonaws.com:11211');
configClient.command(configGetCluster);
function configGetCluster() {
return {
command: 'config get cluster',
callback: handleClusterResponse
@Rich-Harris
Rich-Harris / imperative-v-declarative-imports.md
Last active May 6, 2024 10:23
Why imperative imports are slower than declarative imports

Why imperative imports are slower than declarative imports

A lot of people misunderstood Top-level await is a footgun, including me. I thought the primary danger was that people would be able to put things like AJAX requests in their top-level await expressions, and that this was terrible because await strongly encourages sequential operations even though a lot of the asynchronous activity we're talking about should actually happen concurrently.

But that's not the worst of it. Imperative module loading is intrinsically bad for app startup performance, in ways that are quite subtle.

Consider an app like this:

// main.js