Skip to content

Instantly share code, notes, and snippets.

@shamansir
shamansir / _.js
Last active May 14, 2024 19:35
Parse and convert any SVG path to the list of commands with JavaScript + Regular Expressions
// svgPathToCommands('M10,10 l 5,7 C-5,7.2,.3-16,24,10 z');
//
// produces:
//
// [ { marker: "M", values: [ 10, 10 ] },
// { marker: "l", values: [ 5, 7 ] },
// { marker: "C", values: [ -5, 7.2, 0.3, -16, 24, 10 ] },
// { marker: "z", values: [ ] } ]
//
// commandsToSvgPath(svgPathToCommands('M10,10 l 5,7 C-5,7.2,.3-16,24,10 z'))
@btoone
btoone / curl.md
Last active May 14, 2024 19:32
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@SuppieRK
SuppieRK / CaseMatcher.kt
Last active May 14, 2024 19:29
Regular expressions for case matching
/**
* Different case matchers
*
* @see <a href="https://en.wikipedia.org/wiki/Naming_convention_(programming)#Examples_of_multiple-word_identifier_formats">Examples of multiple word identifier formats</
*/
sealed class CaseMatcher(private val regex: Regex) {
open fun notMatches(source: String?): Boolean {
return !matches(source)
}
@cfstras
cfstras / Installing tcpdump on an arm device without package manager.md
Last active May 14, 2024 19:29
Installing tcpdump on an arm device without package manager
DEVICE=1.2.3.4
MIRROR=http://archives.fedoraproject.org/pub/archive/fedora/linux/releases
FEDORA=29
FILE=tcpdump-4.9.2-6.fc29.armv7hl.rpm  
PACKAGE=Everything/armhfp/os/Packages/t/$FILE

wget $MIRROR/$FEDORA/$PACKAGE

# see https://gist.github.com/cfstras/4856e48fd4d68eb7debaa20d5e63c6de
@mlocati
mlocati / win10colors.cmd
Last active May 14, 2024 19:29
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m
@nhtua
nhtua / 00.install-android-sdk.sh
Last active May 14, 2024 19:27
Run a Headless Android Device on Ubuntu server (no GUI)
#!/bin/bash -i
#using shebang with -i to enable interactive mode (auto load .bashrc)
set -e #stop immediately if any error happens
# Install Open SDK
apt update
apt install openjdk-8-jdk -y
update-java-alternatives --set java-1.8.0-openjdk-amd64
java -version
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active May 14, 2024 19:26
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active May 14, 2024 19:26
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@slintak
slintak / _README.md
Last active May 14, 2024 19:23
Meshtastic AI Chat Assistant Integration

This gist contains a proof of concept project (hacked together during one evening) aimed at connecting an AI chat assistant to the Meshtastic network, enhancing its capabilities. The assistant is designed to provide concise and helpful responses within the constraints of the Meshtastic environment.

Project Overview:

This project brings together two favorite elements: the Meshtastic network and an AI chat assistant. The assistant is based on the "FuseChat-7B-VaRM-Q5_K_M" model, and the code is written in Python.

@briankung
briankung / 00.md
Last active May 14, 2024 19:20
[RFC] Making sense of secure token authentication in Rails

/ be me

/ be working on new Rails API web app

/ ...I can't. I hate this format

...so I was looking up how to do simple, secure authentication in Rails for my super secret project which you definitely can't find by looking at recent activity on my [GitHub account] (Hail [Mammon][[0][zero]]) and realized that I hadn't implemented authentication in Rails in a long time. The closest I'd come to was throwing [Devise] into my app and grumpily remembering to configure the mailer after the fact.

This will seem unrelated, but bear with me: I learned how to calculate interest rates on loans in something like 6th grade. I have since forgotten how to do that without assistance. Much like how I would have been much better prepared to choose a mortgage back then, I would in some ways be much better prepared to figure out authentication a few years ago when I was just starting out in web dev - and had just implemented it from the [Hartl tutorial]. That said, just like how I now know more of what I'm looking for