Skip to content

Instantly share code, notes, and snippets.

@lleyton
lleyton / translation.md
Last active April 16, 2025 06:35
(ENG) Open Source Business Challenges and Reality, Rui Ueyama

Open Source Business Challenges and Reality

Original Japanese note here.

Original Author: Rui Ueyama (creator of the mold linker)

Translated by @windowsboy111

Minimally edited by @lleyton

@davidcortesortuno
davidcortesortuno / clean_youtube_dl_auto_subs.py
Created August 30, 2020 12:04
Remove duplicated lines from a .vtt file generated by youtube-dl when downaloading auto generated Youtube subtitles
# Remove duplicated lines from a .vtt file generated by youtube-dl when
# downloading auto-subs from a Youtube video using the --write-auto-sub option
# This script only prints the lines so save the edited subs as:
#
# python this_script.py original_sub.vtt > new_sub.vtt
import re
import sys
f = open(sys.argv[1])
@bsolomon1124
bsolomon1124 / deprecate_args.py
Created August 4, 2020 17:40
Easy way to deprecate arguments with argparse
import argparse
import warnings
class DeprecateAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
warnings.warn("Argument %s is deprecated and is *ignored*." % self.option_strings)
delattr(namespace, self.dest)
@jphickey
jphickey / sch_custom.c
Created February 25, 2020 16:01
Simplified "custom" logic for CFS SCH applcation
/*
** $Id: sch_custom.c 1.3 2015/03/01 14:01:44EST sstrege Exp $
**
** Copyright 2007-2014 United States Government as represented by the
** Administrator of the National Aeronautics and Space Administration.
** All Other Rights Reserved.
**
** This software was created at NASA's Goddard Space Flight Center.
** This software is governed by the NASA Open Source Agreement and may be
** used, distributed and modified only pursuant to the terms of that
#import <Foundation/Foundation.h>
#import <assert.h>
//Compile with `clang -Os -framework Foundation -fno-objc-arc inlinestorage.m -o inline, run with `inline clever` or `inline naive`
/*
NaiveArray implements a simple immutable NSArray-like interface in probably the most obvious way: store a pointer to a C array of objects
*/
@interface NaiveArray : NSObject {
NSUInteger count;
@mbinna
mbinna / effective_modern_cmake.md
Last active May 15, 2025 16:53
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@hcoles
hcoles / mutation_testing_implementation_notes.md
Created June 7, 2017 13:19
So you want to build a mutation testing system

So you want to build a mutation testing system

Introduction

There have been a lot mutation testing systems, but very few have them have seen succesfull use in industry.

This document is a set of notes that might be helpful for anyone thinking of implementing a mutation testing system for another language.

It represents some of the things we learnt while creating pitest. The choices made by pitest are not neccessarily the best choices for your system. Some of these choices are appropriate only because of the particular quirks of Java and the JVM, and some of them are simply the first idea that we had.

@PaulTaykalo
PaulTaykalo / main.m
Created January 29, 2017 22:14
When floats stops working
#import <Foundation/Foundation.h>
@implementation NSObject (Private)
- (float)doSomethng {
return 42.0;
}
@end
int main(int argc, char * argv[]) {
@autoreleasepool {
NSObject * object = [NSObject new];
@azimin
azimin / search.applescript
Last active December 23, 2016 23:02
Search file for "Header Search Paths"
property fileToSearch : "UCSongTrainerRenderingController.h"
property finalPath : ""
set finalPath to do shell script ("mdfind -name " & fileToSearch & " -onlyin /")
set finalPath to replace_chars(finalPath, "/Users/azimin/iOSDeveloper/Uberchord-iOS", "$(PROJECT_DIR)")
set finalPath to replace_chars(finalPath, "/" & fileToSearch, "")
set finalPath to replace_chars(finalPath, " ", "\\ ")
set the clipboard to finalPath
on replace_chars(this_text, search_string, replacement_string)