Skip to content

Instantly share code, notes, and snippets.

View pkrll's full-sized avatar
🍎

Ardalan Samimi pkrll

🍎
View GitHub Profile
@Sherlouk
Sherlouk / DebugDevice.swift
Last active June 6, 2024 19:38
Debug Profiles - Securely debugging in production
//
// DebugDevice.swift
//
// Copyright 2022 • Sidetrack Tech Limited
//
import Foundation
// This must be called on the main-thread.
var isDebugProfileInstalled: Bool {
@gricard
gricard / webpack4upgrade.md
Last active February 29, 2024 20:23
Just some notes about my attempt to upgrade to webpack 4

If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech

This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team

Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it. All I need to do is npm i -D webpack@next, right?

+ webpack@4.0.0-beta.2
@heloa-net
heloa-net / How-to.md
Created January 4, 2017 01:58
Hiding API keys on GitHub without breaking your project

Backup the API key beforehand in case you have trouble reverting the file.

Let's say the file with a key you want to hide is <filename> Open it and change the API key with a placeholder, like <api-key> Save and add the file to git and commit git commit -m 'Masking API key'

Then revert the file, undoing recent changes so your key is back where it should be and save it. Use git update-index --assume-unchanged

@bmhatfield
bmhatfield / .profile
Last active June 18, 2024 09:38
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@henrik
henrik / dnloader.rb
Last active December 19, 2015 23:35
Dagens Nyheter (DN) PDF downloader for paying subscribers.
# Ruby script for DN subscribers to download the latest DN as a PDF – because it beats their iPad app.
# By Henrik Nyh 2015-12-08 under the MIT license.
#
# INSTRUCTIONS (for advanced users)
#
# Fetch the script dependencies:
#
# (sudo) gem install mechanize
#
# Put your username and password in a ~/.dnloader file separarated by a ":", e.g.:
@plapier
plapier / LaunchStarter.swift
Created May 23, 2015 23:45
Add Login item using Launch Services (Shared List File) in Swift
//
// toggleLaunchAtStartup.swift
// Recents
//
// Created by Phil LaPier on 5/21/15.
// Copyright (c) 2015 Philip LaPier. All rights reserved.
//
// With help from: https://github.com/RamonGilabert/Prodam/blob/master/Prodam/Prodam/LaunchStarter.swift
import Foundation
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@kgn
kgn / gist:1558664
Created January 4, 2012 05:37
Animated NSTableView Scrolling
// Thanks to CuriousKea for getting this started!
// http://stackoverflow.com/a/8480325/239380
- (void)scrollRowToVisible:(NSInteger)rowIndex animate:(BOOL)animate{
if(animate){
NSRect rowRect = [self rectOfRow:rowIndex];
NSPoint scrollOrigin = rowRect.origin;
NSClipView *clipView = (NSClipView *)[self superview];
scrollOrigin.y += MAX(0, round((NSHeight(rowRect)-NSHeight(clipView.frame))*0.5f));
NSScrollView *scrollView = (NSScrollView *)[clipView superview];