Skip to content

Instantly share code, notes, and snippets.

View jeanbmar's full-sized avatar

Jean-Baptiste Martin jeanbmar

View GitHub Profile
@premnirmal
premnirmal / XORCrypt.java
Created September 26, 2014 02:03
Simple yet effective XOR encryption
import java.io.*;
import java.util.*;
/**
* @author Prem Nirmal
*/
public class XORCrypt {
static String value = "SampleStringToBeEncrypted";
static String keyval = "thisIsAKey";
@olegch
olegch / load-cloudformation-jyaml.js
Created February 9, 2017 21:18
Loading a CloudFormation yaml file with custom tags with js-yaml in node.js
'use strict';
var fs = require('fs');
var yaml = require('js-yaml');
var inputStr = fs.readFileSync('../../out/aws-cloud-formation-template-1.template', {encoding: 'UTF-8'});
var CF_SCHEMA = yaml.Schema.create([
new yaml.Type('!Ref', { kind: 'scalar', construct: function (data) { return { 'Ref': data }; } }),
new yaml.Type('!Equals', { kind: 'sequence', construct: function (data) { return { 'Fn::Equals': data }; } }),
@robin-hartmann
robin-hartmann / bundler.js
Last active January 3, 2024 08:00
npm workspaces support for electron-forge
// based on https://github.com/electron-userland/electron-forge/issues/2306#issuecomment-1034882039
'use strict';
/**
* @typedef {{
* new (options: { path: string }): {
* loadActual(): Promise<Node>
* }
* }} Arborist
*/
@atyachin
atyachin / Android_Emulator_AWS_EC2_ARM64_2022.txt
Last active July 21, 2024 06:35
Running headless android emulator on AWS EC2 Ubuntu instance (ARM64 / aarch64) - 2022
Android Emulator (ARM64) on EC2 - 2022
---------------------------------------
1. Launch EC2 ARM based Instance (a1.metal / a1.2xlarge): (16 Gb RAM, 32Gb Disk), Ubuntu Server 22.04 LTS (HVM) ARM x64
2. sudo apt update && sudo apt upgrade
3. sudo apt install default-jdk python3-pip repo python-is-python3 unzip libpcre2-dev adb
4. wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
5. unzip commandlinetools-linux-8512546_latest.zip -d android-sdk
6. sudo mv android-sdk /opt/
7. mkdir /opt/android-sdk/cmdline-tools/latest
8. mv /opt/android-sdk/cmdline-tools/* /opt/android-sdk/cmdline-tools/latest (ignore the error)
@kettanaito
kettanaito / README.md
Last active July 21, 2024 23:17
Chromium on Vercel (serveless)

Chromium on Vercel (serverless)

This is an up-to-date guide on running Chromium in Vercel serverless functions in 2022. What you will read below is the result of two days of research, debugging, 100+ failed deployments, and a little bit of stress.

Getting started

Step 1: Install dependencies

Use chrome-aws-lambda that comes with Chromium pre-configured to run in serverless, and puppeteer-core due to the smaller size of Chromium distributive.