Skip to content

Instantly share code, notes, and snippets.

View catilac's full-sized avatar
🌞

Chirag Davé catilac

🌞
View GitHub Profile
@IanKeen
IanKeen / FocusState.swift
Last active June 26, 2024 07:34
SwiftUI: FocusedState shim for < iOS15
import Combine
import SwiftUI
extension View {
public func focused<T>(file: StaticString = #file, _ state: FocusState<T>, equals value: T) -> some View {
modifier(FocusedModifier(state: state, id: value, file: file))
}
}
@propertyWrapper
palindromeGif() {
if [[ -n "$1" ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
if [[ $2 != '--big' ]]; then
a=$(ls out-static* | wc -l)
for p in $(ls -r out-static*);
do
out=$(printf "out-static-%05d.png" $a)
let "a++"
@holzschu
holzschu / LLVM_for_iOS.sh
Last active June 14, 2024 05:04
Cross-compiling LLVM for iOS
#! /bin/bash
curl http://releases.llvm.org/6.0.0/llvm-6.0.0.src.tar.xz -O
tar xvzf llvm-6.0.0.src.tar.xz
rm llvm-6.0.0.src.tar.xz
cd llvm-6.0.0.src
# get clang
pushd tools
curl http://releases.llvm.org/6.0.0/cfe-6.0.0.src.tar.xz -O
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@jvns
jvns / kernelfuntalk.md
Last active August 24, 2023 16:02
You can be a kernel hacker

Hello!

Did you see my talk at CUSEC? If you're interested in hacking on the Linux kernel, here are some more resources! If you have suggestions for learning about OS X or Windows, or you're interested in learning about BSD, let me know!

Reading kernel code:

@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@timoxley
timoxley / drop_collections.js
Created July 27, 2012 17:30
mongoose drop collections helper
var async = require('async')
var _ = require('underscore')
var Helpers = function(mongoose) {
this.mongoose = mongoose || require('mongoose')
this.dropCollections = function(callback) {
var collections = _.keys(mongoose.connection.collections)
async.forEach(collections, function(collectionName, done) {
var collection = mongoose.connection.collections[collectionName]
@paularmstrong
paularmstrong / a_star.js
Created May 27, 2011 02:33 — forked from jminor/a_star.js
A* path finding algorithm for impactjs game engine
/**
* AStar
*
* Created by Paul Armstrong on 2011-05-26.
* Copyright (c) 2011 Paul Armstrong Designs. All rights reserved.
*
* Based on: https://gist.github.com/827899
*/
ig.module('plugins.a-star')