Skip to content

Instantly share code, notes, and snippets.

@kahunamoore
kahunamoore / lein-m1-vs-intel.md
Created March 19, 2022 08:35 — forked from hagmonk/lein-m1-vs-intel.md
Benchmarking Leiningen on Apple Silicon

Benchmarking Leiningen on Apple Silicon

Gene was tweeting about Clojure's startup performance on Apple Silicon, so I decided to benchmark my new MacBook Air with the M1 chip against my Intel based MacBook Pro.

TL;DR

img

The M1 chip in the MacBook Air - which lacks a fan - was able to quite tidily beat an almost top-of-the-line Intel chip.

@kahunamoore
kahunamoore / CollDetect.cpp
Created February 20, 2020 06:36 — forked from mlfarrell/CollDetect.cpp
Vertical (Wall) Coll Detect
/*** Not optimized or perfect, but hopefully helps someone else learn **/
//https://gamedev.stackexchange.com/questions/96459/fast-ray-sphere-collision-code
static bool intersectRaySegmentSphere(float3 o, float3 d, float3 so, float radius2, float3 &ip)
{
//we pass in d non-normalized to keep it's length
//then we use that length later to compare the intersection point to make sure
//we're within the actual ray segment
float l = d.length();
d /= l;
@kahunamoore
kahunamoore / SmoothGameCameraMovement.cs
Created February 3, 2020 15:49 — forked from IRCSS/SmoothGameCameraMovement.cs
Unity Camera Movement in Game view like Scene View with filtering
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Moves Camera similar to how camera is moved in the Unity view port. Drop the scrip on the game object which has the camera and you wish to move.
public class SmoothGameCameraMovement : MonoBehaviour
{
@kahunamoore
kahunamoore / main.py
Created June 4, 2019 00:16 — forked from khanhnamle1994/main.py
FCN - Full Code
#--------------------------
# USER-SPECIFIED DATA
#--------------------------
# Tune these parameters
num_classes = 2
image_shape = (160, 576)
EPOCHS = 40
BATCH_SIZE = 16
@kahunamoore
kahunamoore / Player.jsx
Created April 17, 2019 15:48 — forked from vincentriemer/Player.jsx
Player code for my Apple Music clone
// @flow
import * as React from "react";
import {
View,
StyleSheet,
Image,
Animated,
TouchableOpacity,
Text,
@kahunamoore
kahunamoore / Player.jsx
Created April 17, 2019 15:47 — forked from vincentriemer/Player.jsx
Player code for my Apple Music clone
// @flow
import * as React from "react";
import {
View,
StyleSheet,
Image,
Animated,
TouchableOpacity,
Text,

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
@kahunamoore
kahunamoore / tga.h
Created February 7, 2019 05:31 — forked from maluoi/tga.h
A super short and streamlined C/C++ function for writing .tga images to file! No dependencies, and no cruft.
// Copyright(c) 2019 Nick Klingensmith (@koujaku). All rights reserved.
//
// This work is licensed under the terms of the MIT license.
// For a copy of this license, see < https://opensource.org/licenses/MIT >
#pragma once
#include <stdio.h>
#include <stdint.h>
@kahunamoore
kahunamoore / trrprefs.md
Created August 8, 2018 14:11 — forked from bagder/trrprefs.md
trr prefs

Preferences

All preferences for the DNS-over-HTTPS functionality in Firefox are located under the "network.trr" prefix (TRR == Trusted Recursive Resolver). The support for these are targeted for shipping in release Firefox 62.

network.trr.mode

set which resolver mode you want.

0 - Off (default). use standard native resolving only (don't use TRR at all)

1 - Race native against TRR. Do them both in parallel and go with the one that returns a result first.

@kahunamoore
kahunamoore / alltheflags.md
Created June 5, 2018 07:22 — forked from CodaFi/alltheflags.md
Every Option and Flag /swift (1.2) Accepts Ever

#Every Single Option Under The Sun

  • optimization level options
  • automatic crashing options
  • debug info options
  • swift internal options
  • swift debug/development internal options
  • linker-specific options
  • mode options