Skip to content

Instantly share code, notes, and snippets.

View fhammerschmidt's full-sized avatar

Florian Hammerschmidt fhammerschmidt

View GitHub Profile
@fhammerschmidt
fhammerschmidt / rescript-vscode-release-process.md
Last active June 6, 2022 21:07
ReScript-VSCode: Proposal for an automated release process
flowchart TD
A[pull request gets merged into master branch]
A-->B[build analysis binaries]

subgraph ci [ ]
subgraph textNode1 [ci.yml]
style textNode1 fill:none,stroke:none
end
B-->C[fetch current highest version - 1.3.0]
@fhammerschmidt
fhammerschmidt / P.re
Created January 14, 2020 13:06
Some bindings/helpers for dealing with Promises in ReasonML/BuckleScript
type t(+'a, +'err);
type noError;
external fromJsPromise: Js.Promise.t('a) => t('a, Js.Promise.error) = "%identity";
external toJsPromise: t('a, 'err) => Js.Promise.t('a) = "%identity";
external relax: t('a, noError) => t('a, 'err) = "%identity";
[@bs.new] external make: ((~resolve: (. 'a) => unit, ~reject: (. 'err) => unit) => unit) => t('a, 'err) = "Promise";
@fhammerschmidt
fhammerschmidt / DateFns.re
Last active November 15, 2019 13:12
DateFns.re
// esm bindings to date-fns
[@bs.module "date-fns/esm/addHours"] external addHours: (Js.Date.t, float) => Js.Date.t = "default";
[@bs.module "date-fns/esm/addMinutes"] external addMinutes: (Js.Date.t, float) => Js.Date.t = "default";
[@bs.module "date-fns/esm/addSeconds"] external addSeconds: (Js.Date.t, float) => Js.Date.t = "default";
[@bs.module "date-fns/esm/compareAsc"] external compareAsc: (Js.Date.t, Js.Date.t) => int = "default";
[@bs.module "date-fns/esm/compareDesc"] external compareDesc: (Js.Date.t, Js.Date.t) => int = "default";
[@bs.module "date-fns/esm/differenceInHours"] external differenceInHours: (Js.Date.t, Js.Date.t) => int = "default";
[@bs.module "date-fns/esm/differenceInMinutes"] external differenceInMinutes: (Js.Date.t, Js.Date.t) => int = "default";
[@bs.module "date-fns/esm/differenceInSeconds"] external differenceInSeconds: (Js.Date.t, Js.Date.t) => int = "default";
@fhammerschmidt
fhammerschmidt / ConvertStyles.re
Created April 19, 2019 00:30
Draft bs-react-native (legacy) to bs-react-native-next converter
open Belt;
let teststring = {|
"container":
style([
flex(1.0),
backgroundColor(Colors.darkBackground),
justifyContent(SpaceBetween),
alignItems(Center),
overflow(Hidden),
@fhammerschmidt
fhammerschmidt / reason.json
Last active January 7, 2019 10:14
ReasonReact vscode snippets (Preferences > User snippets > reason.json)
{
"ReasonReact.statelessComponent": {
"prefix": "rrstat",
"body": "let component = ReasonReact.statelessComponent(__MODULE__);\n\nlet make = (_children) => {\n\t...component,\n\trender: _self =>\n\t\t<div></div>,\n};",
"description": "Create a ReasonReact stateless component"
},
"ReasonReact.reducerComponent": {
"prefix": "rrred",
"body": "type action = | Action1(option(string));\n\ntype state = { state1: option(string) };\n\nlet component = ReasonReact.reducerComponent(__MODULE__);\n\nlet make = children => {\n\t...component,\n\tinitialState: () => { state1: None },\n\treducer: (action, state) =>\n\t\tswitch (action) {\n\t\t| Action1(string1) => ReasonReact.Update({ state1 })\n\t\t},\n\trender: self => <div>{self.state.state1->Belt.Option.getWithDefault(\"\")->ReasonReact.string}</div>,\n};",
"description": "Create a ReasonReact reducer component"
@fhammerschmidt
fhammerschmidt / react-native-audio.patch
Last active October 10, 2018 20:26
react-native-audio patch to fix failing ./assembleRelease
diff -Naur react-native-audio/android/build.gradle react-native-audio-patched/android/build.gradle
--- react-native-audio/android/build.gradle 2018-10-10 13:09:44.000000000 +0200
+++ react-native-audio-patched/android/build.gradle 2018-10-10 22:15:11.000000000 +0200
@@ -1,8 +1,8 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 23
- buildToolsVersion "23.0.2"
+ compileSdkVersion = 26