Skip to content

Instantly share code, notes, and snippets.

@fbartho
fbartho / tipsi-stripe.d.ts
Created Sep 5, 2020
Typings for tipsi-stripe@8.0.0
View tipsi-stripe.d.ts
/*
* File: /src/types/tipsi-stripe/tipsi-stripe.d.ts
* Project: tr_client
* Created Date: 2019-07-18
*
* Initial Implementation: https://github.com/tipsi/tipsi-stripe/pull/384/files
* Also relevant: https://github.com/tipsi/tipsi-stripe/pull/264
*/
declare module "tipsi-stripe" {
import { Component } from "react";
@fbartho
fbartho / API-Generator Readme.md
Created Aug 2, 2019
RFC For a Props Type / Constants / JSDocs Generator for tipsi-stripe
View API-Generator Readme.md

API Generator

This is a little helper module that uses TypeScript to generate the following:

  • props-types checkers for JavaScript -- for import into the appropriate locations
  • jsdocs-style Documentation Comments -- for manual copying into the main API interface
  • String Enums for Android -- for use in extracting objects from the API Bridge
  • String Enums for iOS -- for use in extracting objects from the API Bridge
  • A TypeScript .d.ts file -- Future Feature / .gitignored for now
@fbartho
fbartho / hoc-generics-partial-application.tsx
Last active Jul 26, 2019 — forked from miloszpp/hoc.ts
Test that demonstrates the new Generic Propagation features available in TypeScript 3.4
View hoc-generics-partial-application.tsx
import React from "react";
interface InjectedProps {
injected1: string;
}
interface PubProps<Foo> {
pubProp1: Foo;
}
declare function bind<T>(
component: React.ComponentType<T & InjectedProps>,
@fbartho
fbartho / openx_bash_for_ios
Last active Oct 30, 2018 — forked from johngraham262/openx_bash_for_ios
A simple bash script that will open a `.xcworkspace` if it exists in the current directory, otherwise a `.xcodeproj` if it exists, otherwise nothing. It will print the name of the file that is being opened. When using Cocoapods with iOS apps, a second file is created with the `MyProject.xcworkspace` name, alongside the `MyProject.xcproject` file…
View openx_bash_for_ios
# Add the following lines of code to your `~/.bash_profile`,
# and then run `source ~/.bash_profile` to be able to execute
# this from the command line.
# Originally from: https://gist.github.com/johngraham262/6546595
# Spaces-in-filenames from: https://gist.github.com/johngraham262/6546595#gistcomment-1823783
openx() {
fileToOpen='';
find . -maxdepth 1 -name *.xcworkspace -print0 | while IFS= read -r -d '' file; do
fileToOpen=$file
done
View AsyncMap-DispatchSemaphore.swift
let arr = [1, 2, 3, 4, 5]
print("test")
func someAsyncAPI(_ entry: Int, completion: @escaping (Int) -> Void) {
let sleepTime = max(0,3-entry)
DispatchQueue.global().asyncAfter(deadline: .now() + 0.1 * Double(sleepTime)) {
completion(entry * -1);
}
}
@fbartho
fbartho / Feedback.md
Created Apr 8, 2018
noahhaasis/conwaysGameOfLife Feedback on Request
View Feedback.md

noahhaasis/conwaysGameOfLife Feedback

Notes:

  • Most of my feedback is going to be superficial and possibly wrong!
  • I'm not an active expert in C.
  • I haven't used the SDL toolkit since college.
  • I didn't run this code, I simply looked at it!

README

@fbartho
fbartho / 0. Synology RAID Expansion-Resync Performance.md
Last active Sep 17, 2021
Walkthrough of what I did to increase performance on my Synology NAS box during an expansion, and afterwards.
View 0. Synology RAID Expansion-Resync Performance.md

Performance on Synology RAIDs

(especially while expanding)

Warning: The exact commands may not match for your particular linux OS / Synology(NAS) device. I had to customize the commands after exploring my particular system's setup.

If you're new to linux, or this is a new piece of hardware / a new synology device, jump down to the section called "Inspecting a setup"

Contents

@fbartho
fbartho / swiftformat_noself.sh
Created Aug 4, 2017
Example of a Swift file that breaks swiftformat --self remove
View swiftformat_noself.sh
swiftformat --self remove tmp.swift
@fbartho
fbartho / StencilHello.swift
Created Mar 16, 2017
Stencil -- basic templates get no output?
View StencilHello.swift
// ???
import Stencil
let environment = Environment()
let context = ["name": "kyle"]
print(try environment.renderTemplate(string: "Hello {{ name }}", context: context))
/**
Produces output:
View keybase.md

Keybase proof

I hereby claim:

  • I am fbartho on github.
  • I am fbartho (https://keybase.io/fbartho) on keybase.
  • I have a public key ASBi_0J2KRTAirbomlqcoJ_cyDLRbwneneb5MeMGl9qedwo

To claim this, I am signing this object: