Skip to content

Instantly share code, notes, and snippets.

@bonniss
bonniss / better-sqlite3-cheatsheet.md
Last active May 5, 2024 16:11
better-sqlite3 cheatsheet

Refs:

// Init new db
// If the database file does not exist, it is created
// This happens synchronously, which means you can start executing queries right away
const Database = require('better-sqlite3');
@tantalor
tantalor / moon.html
Created March 12, 2012 22:25
Moon in px
<body style="background: black">
<a href="http://inamidst.com/stuff/notes/csspx">
<img src="http://upload.wikimedia.org/wikipedia/en/thumb/c/c9/Moon_nearside_LRO.jpg/170px-Moon_nearside_LRO.jpg" style="width:24.3px;height:24.3px">
</a>
module MyApp::Controllers
class Test1 < R '/test1'
end
class Test2 < R '/test2'
end
SITE_BASE_URL = "http://www.myapp.com"
# --- --- ---
/* mff.bookmarklet
version 0.0.6
*/
// Lazy initialize our namespace context: mff.bookmarklet
if (typeof(mff) == 'undefined') mff = { };
if (typeof(mff.cookie) == 'undefined') mff.cookie = { };
Base64 = {_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+S
@theinvensi
theinvensi / pagedjs-repeat-table-header.js
Last active May 5, 2024 16:08
pagedjs-repeat-table-header
class RepeatTableHeadersHandler extends Paged.Handler {
constructor(chunker, polisher, caller) {
super(chunker, polisher, caller)
this.splitTablesRefs = []
}
afterPageLayout(pageElement, page, breakToken, chunker) {
this.chunker = chunker
this.splitTablesRefs = []
@st4rdog
st4rdog / msi-afterburner-undervolt-how-to.md
Last active May 5, 2024 16:07
MSI Afterburner Voltage Curve Editor Tutorial - Undervolt

Tutorial

  • Start at default curve.
  • Ctrl-click-drag any point in right-half to bend it until a point intersects with desired mhz/voltage.
  • Select point and adjust to perfection using shift-up-down.
  • Shift-click-drag empty space and select points (including selected point) on the right. Selected point should be left-most point.
  • Shift-Enter twice to flatten all points in selection area. They will flatten to match the selected point.
  • Adjust if required.

Controls

@mackuba
mackuba / core_data_wwdc.json
Last active May 5, 2024 16:03
List of all WWDC talks about Core Data since 2010
[
{
"id": "wwdc2010-118",
"title": "Mastering Core Data",
"description": "Core Data contains a vast set of advanced features to help you better manage your data and evolve your application over time. Master the techniques for working with data in your application, from being more efficient to doing more in the database and changing how you store your data over time. Take your Core Data knowledge to the next level.",
"links": [
[
"HD",
"https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2010__hd/session_118__mastering_core_data.mov"
],
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=hex(b):01,00,00,00,00,00,00,00
@CRTified
CRTified / README.md
Last active May 5, 2024 15:57
VFIO Passthrough on NixOS

VFIO Setup on NixOS

Disclaimer: Nobody else tested my setup so far, so this is a "works on my machine" scenario. I am not responsible for anything you break on your machine (although I'd not expect much harm).

Hardware

My system has the following hardware:

  • Board: ASRock X570 Pro4
@lohhans
lohhans / README-PTBR.md
Last active May 5, 2024 15:56 — forked from PurpleBooth/README-Template.md
Um modelo para fazer um bom README.md

Título do projeto

Um parágrafo da descrição do projeto vai aqui

🚀 Começando

Essas instruções permitirão que você obtenha uma cópia do projeto em operação na sua máquina local para fins de desenvolvimento e teste.

Consulte Implantação para saber como implantar o projeto.