Skip to content

Instantly share code, notes, and snippets.

View natefanaro's full-sized avatar

Nate Fanaro natefanaro

View GitHub Profile
@dch
dch / main.yml
Created December 12, 2018 19:13
ansible zerotier role
---
- name: zerotier | install pkg
pkgng:
state: latest
name:
- net/zerotier
notify: zerotier | restart
tags:
- pkg
- zerotier

iOS Device Model List

iPhone

  • iPhone1,1 — iPhone
  • iPhone1,2 — iPhone 3G
  • iPhone2,1 — iPhone 3GS
  • iPhone3,1 — iPhone 4 (GSM)
  • iPhone3,3 — iPhone 4 (CDMA/Verizon/Sprint)
  • iPhone4,1 — iPhone 4S
  • iPhone5,1 — iPhone 5 (model A1428, AT&T/Canada)
@dedeexe
dedeexe / URLRequest+curlCommand.swift
Last active April 17, 2020 13:08
Convert URL Request to curl command
extension URLRequest {
public func curl(pretty:Bool = false) -> String {
var data : String = ""
let complement = pretty ? "\\\n" : ""
let method = "-X \(self.httpMethod ?? "GET") \(complement)"
let url = "\"" + self.url?.absoluteString ?? "" + "\""
var header = ""
@stevenp
stevenp / gist:a6740694b4e23baccfab
Last active September 10, 2015 23:26
Disable App Transport Security in iOS 9
Add this to the Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
@kukat
kukat / UINavigationBarTitle+Icon.m
Last active March 31, 2021 15:42
UINavigationBar Title with Image
// Icon
UIImage *headerIcon = [UIImage imageNamed:@"store32"];
NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init];
textAttachment.image = headerIcon;
NSAttributedString *icon = [NSAttributedString attributedStringWithAttachment:textAttachment];
// space between icon and title
NSAttributedString *space = [[NSAttributedString alloc] initWithString:@" "];
// Title
@dergachev
dergachev / ssh-forward-clipboard.md
Last active May 8, 2024 09:15
Forward your clipboard via SSH reverse tunnels

Exposing your clipboard over SSH

I frequently administer remote servers over SSH, and need to copy data to my clipboard. If the text I want to copy all fits on one screen, then I simply select it with my mouse and press CMD-C, which asks relies on m y terminal emulator (xterm2) to throw it to the clipboard.

This isn't practical for larger texts, like when I want to copy the whole contents of a file.

If I had been editing large-file.txt locally, I could easily copy its contents by using the pbcopy command:

<?PHP
/**
* pingdom.php
*
* This application will check your server swap, hard drive, cpu, and MySQL conditions.
* It will then generate an appropriate XML file for a Pingdom HTTP Custom check.
*
* If any usage is above your preset thresholds, then a down message will be returned,
* indicating that your server may be under more load than usual, hopefully, providing
* a bit of advanced notice before a true failure due to lack of resources
@adamgit
adamgit / .gitignore
Last active June 2, 2024 09:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active June 14, 2024 06:59
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
@matteoagosti
matteoagosti / client.js
Created June 3, 2012 15:12
Twitter OAUTH using Meteorjs
var ClientRouter = Backbone.Router.extend({
routes: {
'404': 'notfound',
'500': 'error',
'auth': 'auth',
'authCallback?oauth_token=:oauth_token&oauth_verifier=:oauth_verifier': 'authCallback',
'': 'defaultRoute'
},
defaultRoute: function() {