Skip to content

Instantly share code, notes, and snippets.

View viteinfinite's full-sized avatar

Simone Civetta viteinfinite

View GitHub Profile
@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
@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 / 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 / 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"
}
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"}]}'

0 Swiftenv

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

1 Create Project

@viteinfinite
viteinfinite / nsspain2014-slides.md
Last active April 26, 2016 06:28
NSSpain 2014 Slides
@viteinfinite
viteinfinite / Appfile
Last active February 27, 2016 23:47
Xebia's Blog Fastfile Example
# Definit le bundle identifier
app_identifier "fr.xebia.monAppli"
# Definit l'Apple ID du compte associé au compte de l'appli
apple_id "xxx@xebia.fr"
@viteinfinite
viteinfinite / RunTests.sh
Created September 22, 2013 01:33
RunTests.sh to be used with GHUnit-iOS in XCode 5 projects.
#!/bin/sh
# Kill simulator if running
killall -s "iPhone Simulator" &> /dev/null
if [ $? -eq 0 ]; then
killall -m -KILL "iPhone Simulator"
fi
# Remove Springboard daemon which may be pending
launchctl remove 'com.apple.iPhoneSimulator:com.apple.SpringBoard' &> /dev/null
@viteinfinite
viteinfinite / XBImageGalleryLayout.m
Last active December 18, 2015 05:49
Implementation of XBImageGalleryLayout used in the blog post "À la (re)découverte de la UICollectionView"
//
// XBImageGalleryLayout.m
//
// Created by Simone Civetta on 4/24/13.
// Copyright (c) 2013 Xebia IT Architects. All rights reserved.
//
#import "XBImageGalleryLayout.h"
#import <UICollectionView/UICollectionView.h>