Skip to content

Instantly share code, notes, and snippets.

View seifscape's full-sized avatar
:octocat:

Seif Kobrosly seifscape

:octocat:
View GitHub Profile
@gyubokbaik
gyubokbaik / panGestureRecognizerHandler.txt
Created March 29, 2017 00:02
Blog - Dismiss ViewControllers Presented Modally Using Swipe Down
// define a variable to store initial touch position
var initialTouchPoint: CGPoint = CGPoint(x: 0,y: 0)
@IBAction func panGestureRecognizerHandler(_ sender: UIPanGestureRecognizer) {
let touchPoint = sender.location(in: self.view?.window)
if sender.state == UIGestureRecognizerState.began {
initialTouchPoint = touchPoint
} else if sender.state == UIGestureRecognizerState.changed {
if touchPoint.y - initialTouchPoint.y > 0 {
I found the need to route specific machines and ports around the VPN. Since I run the VPN client in my router, all my traffic by default goes through the VPN. but if you have FTP, trackers that dont allow VPN/Proxy, RDP, SSH or other ports that you would like to go through your ISP's IP address there is a way to do this!
I found the answer on a another VPN forum. I can post the link but I am unsure if that will be breaking TorGuards rules.
In a nutshell... what this script does is it makes all of your IP address bypass the VPN, and then it adds rules using
ip_addrs_lst="192.168.1.1-192.168.1.50"
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active March 31, 2025 18:22
Detect new network devices connecting to OpenWrt and send text message
@giannisp
giannisp / gist:848636b35837c0e98324ef5ac5f2aa15
Last active November 20, 2021 08:22
Fix ssh key issues on macOS Sierra 10.12.x
# store passphrase on keychain
ssh-add -K
# and/or add to ~/.ssh/config:
Host *
UseKeychain yes
@chranderson
chranderson / nvmCommands.js
Last active April 19, 2025 05:20
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@thesyntaxinator
thesyntaxinator / Safari save all tabs
Last active January 16, 2025 06:03
Safari save all tabs (tested on Mac OS Sierra 10.12.1 with Safari 10.0.1)
-- Based on code from:
-- https://gist.github.com/agoddard/5114024
-- https://gist.github.com/edenwaith/2213a764ccb091d6a03989f238efb63f
-- https://computers.tutsplus.com/tutorials/generate-a-list-of-open-safari-tabs-with-applescript--mac-30564
-- Instructions
-- 1. Open Automator -> create new Service.
-- 2. Select "no input" and "Safari"
-- 3. Drag "Run AppleScript" to the pane on the right.
-- 4. Paste the below code where it says "(* Your script goes here *)".
@marmelroy
marmelroy / objectiveKit.swift
Last active May 24, 2019 15:11
ObjectiveKit.swift
let mapViewClass = ObjectiveClass<MKMapView>()
let selectors = mapViewClass.selectors // An array of selectors.
let properties = mapViewClass.properties // An array of properties.
mapViewClass.addSelector(#selector(testSelector), from: self.classForCoder)
@chuckreynolds
chuckreynolds / .zshrc
Last active January 7, 2024 20:05
ZSH w/ Oh-My-ZSH config file with bash alias
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
@shahdhiren
shahdhiren / P12toPEM.txt
Created September 9, 2016 14:57
Convert P12 file for Push Notification to PEM format
Development Phase:
Step 1: Create Certificate .pem from Certificate .p12
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
Step 2: Create Key .pem from Key .p12
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
Step 3: Optional (If you want to remove pass phrase asked in second step)
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
@pchhetri
pchhetri / README.md
Last active December 22, 2024 14:15
OS X iMessage (Messages) database merger

OS X iMessage (Messages) database merger

Use it at your own risk! You might end up worse than before. Backup everything beforehand. Twice.

If you have the Messages app setup in multiple Macs with the same Apple ID you may end up with iMessages (or SMS) scattered around all of these Macs. This is because after a certain time the new iMessages (or SMS) recevied will cease to push to devices afer a certain time has elapsed. Thus, if a computer has been offline for some period of time it won't get the new iMessages.

Each Messages instance stores the information in a SQLite database, to consolidate all these databases run the script below. This is where the Messages app stores the SQLite database under ~/Library/Messages, the folder contents will look like as follows:

  • chat.db