Skip to content

Instantly share code, notes, and snippets.

@georgiecel
georgiecel / wp-comment-walker
Last active December 28, 2022 15:16
Custom comment walker for HTML5 friendly WordPress comment and threaded replies. To be inserted in functions.php.
<?php
class comment_walker extends Walker_Comment {
var $tree_type = 'comment';
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' );
// constructor – wrapper for the comments list
function __construct() { ?>
<section class="comments-list">
@glslioadmin
glslioadmin / TEMPLATE.glsl
Last active July 5, 2019 00:55
GLSL.io Transition (v1)
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
void main() {
vec2 p = gl_FragCoord.xy / resolution.xy;
gl_FragColor = mix(texture2D(from, p), texture2D(to, p), progress);
@staltz
staltz / introrx.md
Last active May 30, 2024 18:43
The introduction to Reactive Programming you've been missing
@barneycarroll
barneycarroll / animator.js
Last active June 11, 2021 05:06
A factory for decorating Mithril modules / views / elements with incoming and outgoing animations.
var animating = false;
// Define an animator consisting of optional incoming and outgoing animations.
// alwaysAnimate is false unless specified as true: false means an incoming animation will only trigger if an outgoing animation is also in progress.
// forcing dontClone to true means the outward animation will use the original element rather than a clone. This could improve performance by recycling elements, but can lead to trouble: clones have the advantage of being stripped of all event listeners.
function animator( incoming, outgoing, alwaysAnimate, dontClone ){
// The resulting animator can be applied to any number of components
return function animate( x, y, z ){
var config;
var parent;
1 {
2 "name": "...",
3 "version": "1.0.0",
4 "description": "...",
5 "main": "index.js",
6 "scripts": {
7 "build:css": "stylus --compress ../lib/.../index.styl --out dist/....css",
8 "watch:css": "stylus --watch ../lib/.../index.styl --out dist/....css",
9 "build:js": "browserify ../lib/.../standalone.js --standalone bootstrap > dist/....js",
10 "watch:js": "watchify ../lib/.../standalone.js --standalone bootstrap -o dist/....js",
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active September 23, 2023 09:38
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

@slightfoot
slightfoot / bottom_sheet.dart
Last active February 1, 2024 18:24
Modal Bottom Sheet with Input Fields fix for Flutter (Fix issue with overlap with keyboard and fix for tapping to dismiss)
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@lovasoa
lovasoa / mysql2sqlite.awk
Last active October 28, 2018 23:44 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/usr/bin/awk -f
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite.awk < db-mysql.sql | sqlite3 database.sqlite
# Example: $ mysqldump --no-data -u root -pMySecretPassWord myDbase | ./mysql2sqlite.awk | sqlite3 database.sqlite
@rain-1
rain-1 / LLM.md
Last active May 31, 2024 09:22
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.