Skip to content

Instantly share code, notes, and snippets.

View viteinfinite's full-sized avatar

Simone Civetta viteinfinite

View GitHub Profile

0 Swiftenv

$ brew install kylef/formulae/swiftenv
$ swiftenv install 3.0.2
$ mkdir $project && cd $project && swiftenv local 3.0.2

1 Create Project

curl -X POST http://localhost:4985/couchbaseevents/_bulk_docs -H "Content-Type: application/json" -d '{"new_edits": false, "docs": [{"_id": "event", "name": "aaa", "_rev": "1-123"}, {"_id": "event", "name": "bbb", "_rev": "1-456"}, {"_id": "event", "name": "ccc", "_rev": "1-789"}]}'
@viteinfinite
viteinfinite / build-1.gradle
Last active November 29, 2018 09:59
Understanding The Basics of Multiplatform Projects in Kotlin 1.3
buildscript {
ext.kotlin_version = '1.3.0'
repositories {
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
@viteinfinite
viteinfinite / aws-deploy.sh
Last active December 2, 2020 09:41
Swift Lambda build and package scripts
# Install the jq tool (https://stedolan.github.io/jq/)
# It'll be used to parse the response of the aws cli commands
JQ_PATH=./scripts/jq
if [ ! -f "$JQ_PATH" ]; then
echo "Installing jq"
curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64 --output $JQ_PATH
chmod +x $JQ_PATH
fi
# Create an AWS IAM Role
@viteinfinite
viteinfinite / Default (OSX).sublime-keymap
Last active December 22, 2022 15:29
Sublime Key Bindings for rebasing / editing history
[
{
"keys": ["option+shift+down"],
"command": "move_commit",
"args": { "commit": "$commit", "down": true },
},
{
"keys": ["option+shift+up"],
"command": "move_commit",
"args": { "commit": "$commit", "down": false },
@viteinfinite
viteinfinite / convert.py
Last active July 29, 2023 21:51
Core ML Conversion Script for the Keras Facenet Model
import coremltools
from coremltools.proto import NeuralNetwork_pb2
from coremltools.models.neural_network.quantization_utils import *
import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.utils import np_utils
from keras.models import load_model
import os.path