Skip to content

Instantly share code, notes, and snippets.

@Asseel-Naji
Asseel-Naji / obsidian-web-clipper.js
Last active September 15, 2024 16:18 — forked from kepano/obsidian-web-clipper.js
Prompt_Obsidian Bookmarklet to clip pages
javascript: Promise.all([import('https://unpkg.com/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "Brain";
/* Optional folder name such as "Clippings/" */
@simpsoka
simpsoka / Leadership-CI.md
Last active December 20, 2023 15:40
This is a list of questions to check our decision making.

Do I want to die on this hill?

  • Pass: This is morally good and if not handled has long term consequences
  • Fail: This if self serving

Am I including everyone?

  • Pass: My ego is not driving this conversation
  • Fail: The people in this conversation will only tell me I'm right and not push back
@justin
justin / xcode_switch
Last active July 4, 2019 01:02
Check for the existence of an .xcoderc file in the root of a directory and attempt to switch to that Xcode version + update Carthage
#!/bin/zsh
#
# Check for the existence of an .xcoderc in the root of a project and update the DEVELOPER_DIR
# to point to that specific version of Xcode. Update Carthage dependencies as well.
#
# This is useful for all the switching between Xcode 10.x and 11.x as I am doing presently.
#
# Usage:
# xcode_switch [--no-bootstrap] [version_number]
#
@JohnSundell
JohnSundell / simrecord
Created March 16, 2018 21:05
🎥 Script that lets you start a video recording from the iOS simulator with one command
#!/bin/bash
ITERATION=1
EXTENSION="mp4"
FILENAME="$HOME/Desktop/Simulator Recording.$EXTENSION"
while [ -e "$FILENAME" ]
do
ITERATION=$((ITERATION+1))
FILENAME="$HOME/Desktop/Simulator Recording $ITERATION.$EXTENSION"
#!/usr/bin/sudo ruby
#
# revealer.rb -- Deobfuscate GHE .rb files.
#
# This is simple:
# Every obfuscated file in the GHE VM contains the following code:
#
# > require "ruby_concealer.so"
# > __ruby_concealer__ "..."
@IanKeen
IanKeen / IKScrollView.swift
Last active November 18, 2021 16:34
A UIScrollView subclass that allows you to use scrollviews and autolayout without the drama...
enum SizeMatching {
case Width, Height, Both, None
}
class IKScrollView: UIScrollView {
//MARK: - Outlets
@IBOutlet private var contentView: UIView?
//MARK: - Properties
@IBInspectable var sizeMatching = SizeMatching.Width
@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active May 27, 2024 12:11
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
@lukeredpath
lukeredpath / hsbc.rb
Created September 17, 2012 12:38
Automated HSBC business banking statement downloads
require 'rubygems'
require 'mechanize'
require 'keychain'
class Scraper
def initialize(url)
@url = url
@flows = []
end
require 'rubygems'
require 'prawn'
require 'barby'
require 'barby/barcode/qr_code'
require 'barby/outputter/prawn_outputter'
Prawn::Document.generate("barcode.pdf") do |pdf|
pdf.bounding_box([0, pdf.cursor], :width => 100, :height => 100) do
Barby::QrCode.new("hello", :level => :h).annotate_pdf(pdf)
end
@hmcfletch
hmcfletch / ColorHelper.h
Created January 23, 2012 05:59
A bunch of objective-c color helpers
#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
// generate a UIColor from rgb and alpha values
#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define RGB(r, g, b) RGBA(r, g, b, 1.0)
// generate a UIColor
#define GRAYSCALEA(rgb, a) RGBA(rgb, rgb, rgb, a)
#define GRAYSCALE(rgb) GRAYSCALEA(rgb, 1.0)
// generate a UIColor from a hex and an alpha value