Skip to content

Instantly share code, notes, and snippets.

View rhulha's full-sized avatar

Raymond Hulha rhulha

View GitHub Profile
@rhulha
rhulha / Dockerfile
Created January 27, 2024 06:58 — forked from adtac/Dockerfile
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
import os
import time
import argparse
start = time.time()
os.system("nvidia-smi")
# import libraries
@rhulha
rhulha / babylon_js_6_pirateFort_with_collisions.js
Created April 24, 2023 09:44
PirateFort asset with collisions enabled using Babylon.js 6.0 and Havok Physics
var createScene = function () {
var scene = new BABYLON.Scene(engine);
var camera = new BABYLON.FlyCamera("FlyCamera", new BABYLON.Vector3(0, 5, -10), scene);
camera.attachControl(canvas, true);
var light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);
light.intensity = 0.7;
var hk = new BABYLON.HavokPlugin();
@rhulha
rhulha / breakout2.rs
Created April 30, 2021 07:23
Breakout Step 2
use bevy::{
prelude::*,
render::pass::ClearColor,
};
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.insert_resource(ClearColor(Color::rgb(0.9, 0.9, 0.9)))
.add_startup_system(setup.system())
@rhulha
rhulha / breakout1.rs
Created April 30, 2021 07:20
Breakout Step 1
use bevy::{
prelude::*,
render::pass::ClearColor,
};
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.insert_resource(ClearColor(Color::rgb(0.9, 0.9, 0.9)))
.add_startup_system(setup.system())
Compiling an Android project that depends on OpenSSL using Prefabs
Prefabs are a new feature of the Android Gradle Plugin 4.0.
Here is an outdated but still informative blog post about the subject:
https://android-developers.googleblog.com/2020/02/native-dependencies-in-android-studio-40.html
In the app build.gradle you simply add:
dependencies {
implementation 'com.android.ndk.thirdparty:openssl:1.1.1g-alpha-1'
@rhulha
rhulha / diabotical_rbe_map_files.bt
Created December 13, 2020 23:12
010 Editor Binary Template for the blocks of a Diabotical rbe map file.
LittleEndian();
char signature[4];
uint32 version;
uint64 u1a;
uint64 u1b;
char material_count;
uint32 u2;
uint32 block_count;
@rhulha
rhulha / my_youtube_playlists.py
Last active March 4, 2019 11:54
A Python script that uses the Google Youtube API to retrieve one's own playlists
import os
import json
import os.path
import google.oauth2.credentials
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from google_auth_oauthlib.flow import InstalledAppFlow
CLIENT_SECRETS_FILE = "client_secret.json"
@rhulha
rhulha / Minesweeper.ts
Created December 10, 2018 12:27
Minesweeper implemented in ~100 lines of TypeScript
function ac(type_: string, father: HTMLElement): HTMLElement {
return father.appendChild(document.createElement(type_));
}
function getById(id: string): HTMLElement {
return document.getElementById(id);
}
function shuffle<T>(a: Array<T>) {
for (var i = 81; i >= 0; i--) {
@rhulha
rhulha / all_in_one.py
Created September 18, 2018 13:48
Create a Sophos UTM9 emailpki user
class Config:
REST_BASE_URL = "https://myip:4444/api/"
AUTH=('token', 'mytoken')
import requests
PGP= {
"comment": "",
"emails": [
"[email protected]"