Skip to content

Instantly share code, notes, and snippets.

@realvjy
realvjy / ChoasLinesShader.metal
Last active May 8, 2024 21:57
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@jenskutilek
jenskutilek / avar-slant.py
Last active May 8, 2024 21:53
Axis variation mapping generator for the slant axis
#!/usr/bin/env python
# coding: utf-8
from __future__ import division, print_function
from math import atan, pi, tan
# Spit out some mappings for the slant axis to get closer to actual degrees.
#print(angle,
# atan(
# tan(slant * pi / 180) / (slant / angle)
@sma
sma / sqlite_kv.dart
Created January 26, 2024 13:19
A simple key-value store w/persistent sqlite3 database.
/// A simple key-value store w/persistent sqlite3 database.
class KV {
KV._(this._db);
final Database _db;
static Future<KV> open(String name) async {
return KV._(sqlite3.open(name)..execute('create table if not exists kv (k text primary key, v jsonb)'));
}
Future<Object?> get(String key) async {
@chrismccord
chrismccord / dev.exs
Created May 8, 2024 20:06
Live Reload LiveView notify
config :wps, WPSWeb.Endpoint,
live_reload: [
notify: [
live_view: [
~r"lib/wps_web/core_components.ex$",
~r"lib/wps_web/(live|components)/.*(ex|heex)$"
]
],
patterns: [
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$",
@alejzeis
alejzeis / timezone-mappings.csv
Created March 15, 2017 00:12
Linux-Windows Timezone Mappings CSV
AUS Central Standard Time 001 Australia/Darwin
AUS Central Standard Time AU Australia/Darwin
AUS Eastern Standard Time 001 Australia/Sydney
AUS Eastern Standard Time AU Australia/Sydney Australia/Melbourne
Afghanistan Standard Time 001 Asia/Kabul
Afghanistan Standard Time AF Asia/Kabul
Alaskan Standard Time 001 America/Anchorage
Alaskan Standard Time US America/Anchorage America/Juneau America/Metlakatla America/Nome America/Sitka America/Yakutat
Aleutian Standard Time 001 America/Adak
Aleutian Standard Time US America/Adak
@oodavid
oodavid / README.md
Created March 26, 2012 17:05
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@timc1
timc1 / use-dropzone.tsx
Last active May 8, 2024 21:46
A React hook that returns whether a file is being dragged into the document from the operating system and not from within the browser.
import React from 'react'
type DropzoneContextValue = {
isDragging: boolean
}
const DropzoneContext = React.createContext<DropzoneContextValue | undefined>(
undefined
)

This emulate's vim's <C-e> and <C-y> for scrolling in VSCode using the macros extension.

scrolling vscode editor

  1. add the following to settings.json
"macros": {
  "scrollLineDownFaster": [
 "scrollLineDown",
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 8, 2024 21:46
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@conorbranagan
conorbranagan / gist:4513828
Last active May 8, 2024 21:45
Linux System Metrics

Linux System Metrics

CPU

  • system.cpu.idle: % Idle CPU
  • system.cpu.system: % System CPU
  • system.cpu.user: % User CPU

Disk