Skip to content

Instantly share code, notes, and snippets.

View Glavin001's full-sized avatar
πŸ’»
Working - I may be slow to respond.

Glavin Wiechert Glavin001

πŸ’»
Working - I may be slow to respond.
View GitHub Profile
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 11, 2026 16:34
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Khoulaiz
Khoulaiz / gist:41b387883a208d6e914b
Last active December 3, 2025 13:13
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@LizardLeliel
LizardLeliel / layeredNetwork.py
Created June 25, 2015 19:08
Two multi-layered perception neural networks, one using theano and the other not.
# My first layered neural network thingy,
# Whooooo.
# No Theano just yet. Maybe Numpy.
# Numpy will require me to express everything
# with as little iteration as possible. That's
# what bugs me about that library >_<. You can
# only hope everything broadcasts correctly!
import numpy
import theano
@LizardLeliel
LizardLeliel / geneNetwork.py
Created June 22, 2015 14:51
Its a hardcoded neural network that was built so I could have just a neural network, regardless of implementation (so I can build off, reference, change, etc.). By the way its python3
# How nessecary is this?
class Gene:
def __init__(self, inNeuron, outNeuron, weight = 1):
# inNeuron and outNeuron represent array indices
self.inNeuron = inNeuron
self.outNeuron = outNeuron
self.weight = weight
def compareOuts(self, otherGene):
if self.outNeuron < otherGene.outNeuron: return -1
elif self.outNeuron > otherGene.outNeuron: return 1
@RobTrew
RobTrew / soundDeviceToggle.js
Last active January 6, 2025 21:45
Toggling OS X Sound Output Devices with JXA Javascript for Automation (OS X 10.10)
// Rob Trew @complexpoint 2015
function run() {
"use strict";
var blnUseKeyboardMaestro = false;
// EDIT TO NAMES OF TWO ALTERNATIVE SOUND OUTPUT DEVICES
var dctSources = { // A unique substring for each is enough
primary: "Internal",
secondary: "Elgato"
@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active April 18, 2026 17:04
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@gafferongames
gafferongames / delta_compression.cpp
Last active February 24, 2026 05:02
Delta Compression
/*
Delta Compression by Glenn Fiedler.
This source code is placed in the public domain.
http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/
*/
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
@roryokane
roryokane / 1 – myers (default) algorithm.diff
Last active January 2, 2026 08:07
Comparison between Git diff algorithms: myers (default) vs. patience (example favors patience)
diff --git a/file.c b/file.c
index 6faa5a3..e3af329 100644
--- a/file.c
+++ b/file.c
@@ -1,26 +1,25 @@
#include <stdio.h>
-// Frobs foo heartily
-int frobnitz(int foo)
+int fib(int n)
@sebmarkbage
sebmarkbage / Enhance.js
Last active March 29, 2026 17:42
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@bonzanini
bonzanini / create_proximity.sh
Created February 8, 2015 17:57
Elasticsearch Proximity/Phrase Search
curl -XDELETE http://localhost:9200/test/articles
curl -XPUT http://localhost:9200/test/_mapping/articles -d '{
"properties": {
"content": {
"type": "string",
"position_offset_gap": 100
}
}
}'