Skip to content

Instantly share code, notes, and snippets.

@sapher
sapher / crane_delete_repo.sh
Created November 5, 2022 19:00
crane delete repo
View crane_delete_repo.sh
crane auth login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
crane delete "${FULL_IMAGE_NAME}@$(crane digest ${FULL_IMAGE_NAME})"
View reload_with_external_secret.md

Install and configure External Secret Operator (ESO)

Install external-secret with Helm

helm repo add external-secrets https://charts.external-secrets.io

helm upgrade --install --create-namespace -n eso external-secrets \
    external-secrets/external-secrets \
    -n external-secrets \
@sapher
sapher / main.py
Created July 15, 2022 16:32
Parse SUPER U monmagasin U ticket
View main.py
#!/usr/bin/env python3
from asyncore import read
import argparse
from PyPDF2 import PdfReader
import re
import json
if __name__ == "__main__":
View SimpleOrientationListener.java
package sapher.com.instabooth.ui;
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
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
sapher / my_activity.java
Created February 5, 2017 11:22
Bluetooth with Android +6
View my_activity.java
package gardenator.sapher.com.gardenator.activities;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import org.androidannotations.annotations.AfterViews;
@sapher
sapher / template.json
Last active June 3, 2019 04:50
Packer.io 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": "https://releases.rancher.com/os/{{ user `ros_version` }}/rancheros.iso",
@sapher
sapher / aws-elastictranscoder.java
Created May 17, 2016 17:19
Simple Snippet that show how to create a conversion job on AWS ElasticTranscoder
View aws-elastictranscoder.java
// Create ElasticTranscoderClient
AWSCredentials credentials = new DefaultAWSCredentialsProviderChain().getCredentials();
AmazonElasticTranscoderClient client = new AmazonElasticTranscoderClient(credentials);
client.configureRegion(Regions.US_WEST_2);
// JobInput
JobInput jobInput = new JobInput();
jobInput.setKey(key); // name of the input object in your source S3
// Create JobOuput
@sapher
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
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 : */
/* http://akizukidenshi.com/download/ds/aosong/DHT11.pdf */
/******************************************************************************/
#include <xc.h>