Skip to content

Instantly share code, notes, and snippets.

View jayantnd's full-sized avatar

Jayant Dash jayantnd

  • Comcast
  • Philadelphia
View GitHub Profile
set -ex
if [ $# -ne 3 ]; then
echo usage: $0 jenkins_home git_repos_url backup_folder
exit 1
# Jenkins home folder
jayantnd / .env
Created February 10, 2021 03:59 — forked from joshdholtz/.env
Using Dotenv and environment variables with fastlane
STUFF = this is some stuff
jayantnd /
Created February 9, 2021 18:45 — forked from darencard/
Automatic file git commit/push upon change

Automatically push an updated file whenever it is changed


  1. Make sure inotify-tools is installed (
  2. Configure git as usual
  3. Clone the git repository of interest from github and, if necessary, add file you want to monitor
  4. Allow username/password to be cached so you aren't asked everytime
git config credential.helper store

My bash-fu is laughable and this took me days (yes, days!) to put together, so hope it helps.

It uses fswatch which you should have installed and is supposedly cross-platform, but I've only tested it on MacOS (brew install fswatch).

Dotfile Dropbox git auto-committer

This is my use case:

  • I keep my dotfiles in multiple git repos under ~/Dropbox/dotfiles.
  • I symlink them to wherever they need to be.
jayantnd / CertificatePinningURLSessionDelegate.swift
Created November 6, 2018 18:57 — forked from daniel-rueda/CertificatePinningURLSessionDelegate.swift
Certificate and Public Key Pinning for URLSession using Swift
// Based on
import Foundation
import Security
struct Certificate {
let certificate: SecCertificate
let data: Data
jayantnd /
Created October 28, 2018 20:53 — forked from ftvs/
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: Explanation:
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
jayantnd / AppStoryboard.swift
Created October 7, 2018 17:34 — forked from Gurdeep0602/AppStoryboard.swift
AppStoryboard enumeration
// AppStoryboards.swift
// AppStoryboards
// Created by Gurdeep on 15/12/16.
// Copyright © 2016 Gurdeep. All rights reserved.
import Foundation
import UIKit
import Foundation
import PlaygroundSupport
/// A thread-safe array.
public class SynchronizedArray<Element> {
fileprivate let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent)
fileprivate var array = [Element]()
// MARK: - Properties
jayantnd / channel-example.swift
Created July 27, 2017 15:19 — forked from kainosnoema/channel-example.swift
Golang-like concurrency semantics in Swift
import Foundation
go(println("in a thread"))
// buffered channel
var c = Chan(buffer:20)
// sending routing
go {
while(true) {