Skip to content

Instantly share code, notes, and snippets.

View allenhsu's full-sized avatar
🎯
Focusing

Allen Hsu allenhsu

🎯
Focusing
View GitHub Profile
@ayyybe
ayyybe / ccdl.command
Last active August 17, 2025 17:55
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@DarthSim
DarthSim / 00.imgproxy_vs_alternatives.md
Last active October 19, 2025 08:46
imgproxy vs alternatives benchmark

Important

These benchmark results are outdated.

Check out our blog post for the latest benchmark results.

imgproxy vs alternatives benchmark

Setup

  • c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
import Foundation
struct Partial<Wrapped>: CustomStringConvertible, CustomDebugStringConvertible {
enum Error<ValueType>: Swift.Error {
case missingKey(KeyPath<Wrapped, ValueType>)
case invalidValueType(key: KeyPath<Wrapped, ValueType>, actualValue: Any)
}
private var values: [PartialKeyPath<Wrapped>: Any?] = [:]
@smosko
smosko / UIResponder+Events.swift
Last active April 23, 2019 12:57
Bubble up events from child ViewControllers using the UIResponder chain
// LocationPickerViewController.swift
class LocationPickerViewController: UITableViewController {
...
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
didSelectLocation(locations[indexPath.row])
}
}
extension UIResponder {
@lelandrichardson
lelandrichardson / react-native.js
Last active July 21, 2022 17:56
React Native flow types
declare var __DEV__: boolean;
declare module 'react-native' {
declare type Color = string | number;
declare type Transform =
{ perspective: number } |
{ scale: number } |
{ scaleX: number } |
@inamiy
inamiy / SwiftElmFrameworkList.md
Last active March 11, 2024 10:20
React & Elm inspired frameworks in Swift
@mikoim
mikoim / README.md
Last active October 2, 2025 02:55
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@sebmarkbage
sebmarkbage / Enhance.js
Last active June 19, 2025 19:41
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@lexrus
lexrus / WTF_YOU_MUST_UPGRADE_COCOAPODS.sh
Created May 28, 2014 10:34
Force your little brother to upgrade CocoaPods.
NEW_VER="0.33.1"
POD_VER=`pod --version 2>/dev/null`|| POD_VER=`~/.rbenv/shims/pod --version 2>/dev/null`
if [[ "$POD_VER" != *$NEW_VER ]]; then
echo "error: WTF! You MUST upgrade cocoapods!!!"
exit 1
fi
@bomberstudios
bomberstudios / sketch-plugins.md
Last active July 16, 2025 18:21
A list of Sketch plugins hosted at GitHub, in no particular order.