Skip to content

Instantly share code, notes, and snippets.

View South-Paw's full-sized avatar
👨‍💻

Alex Gabites South-Paw

👨‍💻
View GitHub Profile
@janpio
janpio / timescaledb-quickstart-node-prisma.md
Last active March 4, 2024 03:40
Quick Start: Node, Prisma and TimescaleDB

Quick Start: Node, Prisma and TimescaleDB

Goal

This quick start guide is designed to get the Node.js developer up and running with TimescaleDB as their database.

Pre-requisites

To complete this tutorial, you will need a cursory knowledge of the Structured Query Language (SQL). The tutorial will walk you through each SQL command, but it will be

@sindresorhus
sindresorhus / esm-package.md
Last active May 4, 2024 15:48
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@serg0x
serg0x / material-design-shadows.css
Last active July 7, 2023 13:33
Google material design elevation system shadows as css. Based on https://material.io/design/environment/elevation.html#default-elevations Exported with Sketchapp from the Google material design theme editor plugin "Baseline" theme.
/* Shadow 0dp */
box-shadow: none;
/* Shadow 1dp */
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.20);
/* Shadow 2dp */
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.20);
/* Shadow 3dp */
@South-Paw
South-Paw / gist:ab7a5bff5f4ca2a9555c728947083f10
Last active December 27, 2018 01:01
Git: Add empty initial commit
git commit --allow-empty -m "Initial commit"
@shawngmc
shawngmc / incremental_game_optimization.md
Last active November 25, 2021 09:31
Incremental Game Optimization in JS

Incremental games are great - they can also be fun to write - but making one that's truly a keeper requires careful design. I've dropped too many games because they peg my PC or are throttled, and as a developer I know it's avoidable. So - let's discuss it!

Background tab throttling / document focus

One of the first things to keep in mind is that your game should behave differently if it is not in the foreground. Why? As a protective measure, web browsers limit the activity of background tabs:

Managing Display Updates

Why?

@nepsilon
nepsilon / how-to-git-patch-diff.md
Last active April 19, 2024 13:33
How to generate and apply patches with git? — First published in fullweb.io issue #33

How to generate and apply patches with git?

It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what diff outputs to your local working copy.

You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process:

1. Generate the patch:

git diff > some-changes.patch
@tylerneylon
tylerneylon / json.lua
Last active April 19, 2024 21:02
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.
@remy
remy / gist:2484402
Created April 24, 2012 22:45
jquery.marquee.js
/**
* author Remy Sharp
* url http://remysharp.com/tag/marquee
*/
(function ($) {
$.fn.marquee = function (klass) {
var newMarquee = [],
last = this.length;
@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/