Skip to content

Instantly share code, notes, and snippets.

sapher /
Created November 5, 2022 19:00
crane delete repo
crane delete "${FULL_IMAGE_NAME}@$(crane digest ${FULL_IMAGE_NAME})"

Install and configure External Secret Operator (ESO)

Install external-secret with Helm

helm repo add external-secrets

helm upgrade --install --create-namespace -n eso external-secrets \
    external-secrets/external-secrets \
    -n external-secrets \
sapher /
Created July 15, 2022 16:32
Parse SUPER U monmagasin U ticket
#!/usr/bin/env python3
from asyncore import read
import argparse
from PyPDF2 import PdfReader
import re
import json
if __name__ == "__main__":
import android.content.Context;
import android.content.res.Configuration;
import android.view.OrientationEventListener;
import android.view.Surface;
import android.view.WindowManager;
import java.util.concurrent.locks.ReentrantLock;
sapher / lambda.js
Last active May 25, 2017 04:24
AWS Lambda (use lambda proxy) for registering FCM refresh token to AWS SNS
View lambda.js
const AWS = require('aws-sdk');
const SnsClient = new AWS.SNS();
const createEndpoint = (platformAppArn, token, callback) => {
const createParams = {
PlatformApplicationArn: platformAppArn,
Token: token
sapher /
Created February 5, 2017 11:22
Bluetooth with Android +6
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.os.Build;
import android.util.Log;
import org.androidannotations.annotations.AfterViews;
sapher / template.json
Last active June 3, 2019 04:50 template file for RancherOS
View template.json
"variables": {
"ros_version" : "v0.5.0",
"iso_md5" : "467caa8394684ba54e8731aed8480652",
"vm_name" : "rancher_image"
"builders": [
"type": "vmware-iso",
"iso_url": "{{ user `ros_version` }}/rancheros.iso",
sapher /
Created May 17, 2016 17:19
Simple Snippet that show how to create a conversion job on AWS ElasticTranscoder
// Create ElasticTranscoderClient
AWSCredentials credentials = new DefaultAWSCredentialsProviderChain().getCredentials();
AmazonElasticTranscoderClient client = new AmazonElasticTranscoderClient(credentials);
// JobInput
JobInput jobInput = new JobInput();
jobInput.setKey(key); // name of the input object in your source S3
// Create JobOuput
sapher / sdl2_window_example.c
Created December 29, 2015 08:41
SDL2 Basic Window code example
View sdl2_window_example.c
#include <stdbool.h>
#include <SDL.h>
int main(int argc, char** argv) {
// Declaration
SDL_Window* window;
SDL_Renderer* renderer;
bool isRunning = true;
sapher / pic16f1705_dht11.c
Last active August 29, 2015 14:18
Example of using a DHT11 sensor with a PIC16F1704. We use Timer2 to handle the timing part.
View pic16f1705_dht11.c
/* This example is running on a PIC16F1704 @ 4Mhz INTOSC */
/* To use it you need to configure your OSC and other things. */
/* The SIGNAL pin of the DHT11 is wired to the RA4 pin */
/* We add a little margin for all timing (~) */
/* Some information about the DHT11 : */
/* */
#include <xc.h>