Skip to content

Instantly share code, notes, and snippets.

@brennanMKE
brennanMKE / README.md
Last active September 5, 2025 12:21
Create SSH Key on Mac for Xcode

Create SSH Key on Mac for Xcode

The docs for GitHub show a command to create a key with the ed25519 encryption method which is not allowed by Xcode. Even if you are not using the Source Control features in Xcode you will often need to use an account with GitHub when you are consuming Swift packages which are pulled from GitHub.

For SSH keys there are 4 algorithms.

  • 🚨 DSA: This is an older algorithm which is no longer supported and is superceded with more modern algorithms.
  • ⚠️ RSA: This algorithm was an improvement but it is now outdated and a more modern method should be used.
  • 👀 ECDSA: Another improvement which is dependent on your computer's ability to generate random numbers.
  • ✅ Ed25519: The most recommended public-key algorithm today which you should use with GitHub.
@rsheeter
rsheeter / MyFontProvider.java
Created February 6, 2019 22:35
Fonts ContentProvider
// Notes on ContentProvider to fulfil requests for fonts, such as from FontsContractCompat.
// Not all imports shown
import android.provider.FontsContract.Columns;
public abstract class MyFontProvider extends ContentProvider {
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
String query = selectionArgs[0]; // change based on your input pattern
@hqlulu
hqlulu / gist:ffeaac0e7273be723e5bebe7a25fa338
Created June 1, 2016 07:37
UILongPressGestureRecognizer
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]
initWithTarget:self
action:@selector(handleLongPress:)];
longPress.minimumPressDuration = 1.0;
[myView addGestureRecognizer:longPress];
[longPress release];
- (void)handleLongPress:(UILongPressGestureRecognizer *)gesture {
if(UIGestureRecognizerStateBegan == gesture.state) {
@gimdongwoo
gimdongwoo / CloudCode.js
Last active July 12, 2020 14:48
Background Job in Parse Server (node/cron)
// src/CloudCode.js
"use strict"
var Cron = require('./Cron');
var Job = require('./Job');
class CloudCode {
constructor(Parse, timezone){
this.Parse = Parse;
@acdha
acdha / get-unicode-blocks.py
Created June 12, 2015 22:32
Ways to get the name of a Unicode block for a character in Python
#!/usr/bin/env PYTHONIOENCODING=utf-8 python
# encoding: utf-8
from __future__ import absolute_import, print_function, unicode_literals
import os
import re
import requests
@floatdrop
floatdrop / gulpfile.js
Last active January 6, 2021 23:22
gulp.src - working with multiple source in one task
// npm i gulp event-stream
var gulp = require('gulp');
var es = require('event-stream');
gulp.task('test', function(cb) {
return es.concat(
gulp.src('bootstrap/js/*.js')
.pipe(gulp.dest('public/bootstrap')),
gulp.src('jquery.cookie/jquery.cookie.js')
@tekram
tekram / gist:5430949
Last active December 26, 2018 20:54
def acceptsSMS?(number)
number = number.gsub(/[^0-9]/, "")
uri = URI('http://www.searchbug.com/tools/landline-or-cellphone.aspx?FULLPHONE=' + number)
response = Net::HTTP.get(uri)
return response.include?('CELLULAR')
end
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active October 29, 2025 02:38
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@rduplain
rduplain / app.py
Created May 20, 2012 16:45
Add a second static directory to Flask, in ../static/.
from flask import Flask, send_from_directory
app = Flask(__name__)
@app.route('/base/<path:filename>')
def base_static(filename):
return send_from_directory(app.root_path + '/../static/', filename)
@9re
9re / .gitignore
Created November 30, 2011 01:09
InputFilter & DynamicLayout
gen/
bin/
.classpath
.project