Skip to content

Instantly share code, notes, and snippets.

View jcayzac's full-sized avatar

Julien Cayzac jcayzac

View GitHub Profile
@ThePredators
ThePredators / readme-mde.md
Last active June 8, 2024 09:56
Setup Mobile Development Environment

⭐ Setup Mobile Development Environment

⚠️ The following configuration has been tested on Intel, M1 & M2 Ships ⚠️

Pre-requisit :

If you have any issues with macOS, or need anything related to it check this documentation

Install Xcode Command Line tools :

@pathnirvana
pathnirvana / AsyncJava.js
Last active January 31, 2024 18:15
Async Await call to JavascriptInterface Android Java WebView
// Allows to call a Android java function asynchronously
// spawn long running computations/io on the Java/Android without blocking the JS/Website running inside the WebView
// Eg. const result = await callAndroidAsync('javaFunction', { param1: 'value1', param2: 'value2' })
// Please give a star if you find this useful
export async function callAndroidAsync(javaFuncName, params) {
const rand = 'asyncJava_' + Math.floor(Math.random() * 1000000)
window[rand] = {}
// func called from android
@4np
4np / HowTo use xcconfig or plist with SPM.md
Last active June 18, 2024 15:12
How to use a .xcconfig file and a .plist with a Swift Package Manager based project.

How to use a .xcconfig file and a .plist file with SPM

Worth a read for some more context.

Create a Package.xcconfig file

Create the file in the root of the project (where your Package.swift file lives as well), and use the following contents:

/// Package.xcconfig
@dam5s
dam5s / Result.kt
Last active June 22, 2022 21:28
Railway oriented programming in Kotlin - This is code accompanying my blog post https://medium.com/@its_damo/error-handling-in-kotlin-a07c2ee0e06f
sealed class Result<A, E> {
fun <B> map(mapping: (A) -> B): Result<B, E> =
when (this) {
is Success -> Success(mapping(value))
is Failure -> Failure(reason)
}
fun <B> bind(mapping: (A) -> Result<B, E>): Result<B, E> =
when (this) {
is Success -> mapping(value)
@jart
jart / WORKSPACE
Last active October 29, 2018 06:10
Google Auto and Dagger Bazel Config
load("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external")
java_import_external(
name = "com_google_auto_common",
jar_sha256 = "eee75e0d1b1b8f31584dcbe25e7c30752545001b46673d007d468d75cf6b2c52",
jar_urls = [
"http://domain-registry-maven.storage.googleapis.com/repo1.maven.org/maven2/com/google/auto/auto-common/0.7/auto-common-0.7.jar",
"http://repo1.maven.org/maven2/com/google/auto/auto-common/0.7/auto-common-0.7.jar",
],
licenses = ["notice"], # Apache 2.0
@inesusvet
inesusvet / proto.js
Last active September 21, 2023 05:34
module.exports = {
package: null,
syntax: "proto2",
messages: [{
name: "Msg",
syntax: "proto2",
fields: [{
rule: "optional",
type: "Commands",
name: "command_number",
@jerrymarino
jerrymarino / run_ios_sim.sh
Last active June 5, 2024 03:54
Build and run an iOS application on the simulator from the command line
#!/bin/bash
# run_ios_sim builds and runs an iOS app on the simulator
#
# It is designed to replicate the behavior of "Run" in Xcode and assumes basic
# xcodebuild usage.
#
# USAGE:
# export IOS_SIM_UDID=342F9A20-DF48-41A9-BE60-C6B35F47E97F; \
# export BUNDLE_IDENTIFIER=a.Some; \
# export APP_PATH=$PWD/Build/Debug-iphonesimulator/$APP_NAME.app \
@gregjhogan
gregjhogan / curl-push-azure-storage-blob.sh
Created April 20, 2017 18:13
Push a file to a blob in an Azure storage account
curl -X PUT -T ./{file.dat} -H "x-ms-date: $(date -u)" -H "x-ms-blob-type: BlockBlob" "https://{storageaccount}.blob.core.windows.net/backups/{file.dat}?{sas-token}"
@leo60228
leo60228 / functor.js
Created March 24, 2017 19:47
ES6 Functors
class Functor {
constructor(...args) {
var self = this;
if (typeof this.constructor._functorlock === 'undefined') {
this.constructor._functorlock = true;
return ((functorClass) => {
var inst = new self.constructor(...args);
var out = inst.call.bind(inst);
for (let i of (Object.getOwnPropertyNames(inst).concat(Object.getOwnPropertyNames(Object.getPrototypeOf(inst))))) {