Skip to content

Instantly share code, notes, and snippets.

View hanishassim's full-sized avatar
🎯
Focusing

Hanis hanishassim

🎯
Focusing
View GitHub Profile
@hanishassim
hanishassim / ssh_tunnel.sh
Created May 16, 2017 07:44 — forked from belo82/ssh_tunnel.sh
SSH tunnel from local port 9200 to remote port 9200 (-f: run in background -N: don't execute command in remote system)
ssh -f -L 9201:localhost:9200 <username>@<host> -N
# To kill tunnel running in background run:
ps aux | grep 9201
kill <pid>
@hanishassim
hanishassim / NYSKeyboardHelper.swift
Created September 20, 2018 14:39 — forked from louisdh/NYSKeyboardHelper.swift
A Keyboard helper for your Swift Keyboard troubles.
//
// NYSKeyboardHelper.swift
// B-NYS GCV
//
// Created by Matthias Nys on 18/03/2017.
// Copyright © 2017 B-NYS. All rights reserved.
//
import UIKit
@hanishassim
hanishassim / timeago.swift
Last active November 1, 2018 11:20
Time Ago Swift Date Extension
//Credit to https://gist.github.com/merlos All copyright & credit goes to him
import Foundation
extension Date {
///
/// Provides a humanised date. For instance: 1 minute, 1 week ago, 3 months ago
///
/// - Parameters:
// - numericDates: Set it to true to get "1 year ago", "1 month ago" or false if you prefer "Last year", "Last month"
@hanishassim
hanishassim / gist:9023a3a8b1765e04e2c63ea78d578489
Created November 23, 2018 12:12 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@hanishassim
hanishassim / iOS.8.3.txt
Created December 26, 2018 21:09
iOS UIFont names
UIFont: family Thonburi
UIFont: font Thonburi-Bold
UIFont: font Thonburi
UIFont: font Thonburi-Light
UIFont: family Khmer Sangam MN
UIFont: font KhmerSangamMN
UIFont: family Snell Roundhand
UIFont: font SnellRoundhand-Black
UIFont: font SnellRoundhand-Bold
UIFont: font SnellRoundhand
@hanishassim
hanishassim / install-wakatime.sh
Last active August 26, 2019 06:50
wakatime install path
#!/usr/bin/env bash
set -euo pipefail
set +e
xcrun xcodebuild -version > /dev/null 2>/dev/null
RESULT="$?"
set -e
if [ $RESULT != 0 ]; then
sudo xcode-select --reset
@hanishassim
hanishassim / SmoothedView.swift
Created February 23, 2020 13:34
Superclass to create a smooth rounded UIView, works for animated rounded view too
//
// SmoothedView.swift
//
// Created by H on 23/02/2020.
// Copyright © 2020 H. All rights reserved.
//
import UIKit
final class SmoothedView: UIView {
@hanishassim
hanishassim / RoundedCorners.swift
Created February 23, 2020 13:38
Superclass to create rounded UIView (alternative to SmoothedView)
//
// RoundedCorners.swift
//
// Created by H on 23/02/2020.
// Copyright © 2020 H. All rights reserved.
//
import UIKit
protocol RoundedCorners {