Skip to content

Instantly share code, notes, and snippets.

View MichaelVanDenBerg's full-sized avatar
🏠
Working from home

Michael van den Berg MichaelVanDenBerg

🏠
Working from home
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active June 27, 2024 18:48
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@caspg
caspg / 1_searchbar_live.ex
Last active June 21, 2024 14:23
Example of real-time search bar implementation in Phoenix LiveView and Tailwind. Working example on https://travelermap.net/parks/usa
defmodule TravelerWeb.SearchbarLive do
use TravelerWeb, :live_view
alias Phoenix.LiveView.JS
alias Traveler.Places
def mount(_params, _session, socket) do
socket = assign(socket, places: [])
{:ok, socket, layout: false}
end
@peterc
peterc / pg_available_extensions.txt
Created February 14, 2019 18:40
Which Postgres extensions are available on DigitalOcean's new managed PostgreSQL service?
defaultdb=> SELECT * FROM pg_available_extensions;
name | default_version | installed_version | comment
------------------------------+-----------------+-------------------+---------------------------------------------------------------------------------------------------------------------
aiven_extras | 1.0.2 | | aiven_extras
plpgsql | 1.0 | 1.0 | PL/pgSQL procedural language
btree_gist | 1.5 | | support for indexing common datatypes in GiST
tcn | 1.0 | | Triggered change notifications
seg | 1.3 | | data type for representing line segments or floating-point intervals
pgrowlocks | 1.2 |
@iign
iign / gulpfile.js
Last active November 14, 2016 19:11
Basic Gulpfile
var gulp = require('gulp')
var sass = require('gulp-sass')
var autoprefixer = require('gulp-autoprefixer')
var browserSync = require('browser-sync').create()
gulp.task('sass', function () {
gulp.src('sass/**/main.scss')
.pipe(sass({outputStyle: 'uncompressed'}).on('error', sass.logError))
.pipe(autoprefixer('last 3 versions', '> 1%', 'ie 8'))
.pipe(gulp.dest('./css'))
@Lakerfield
Lakerfield / index.html
Last active January 11, 2024 15:36
Print ZPL from browser
<!doctype html>
<html lang="en">
<head>
<title>Print ZPL from browser</title>
</head>
<body>
<h1>Test page for print ZPL from browser!</h1>
<script type="text/javascript">
function printZpl(zpl) {
@devinsays
devinsays / custom-logo-update-script.php
Last active April 17, 2016 12:49
Code snippet for update script to use new theme logo
<?php
/**
* Theme Update Script
*
* Runs if version number saved in theme_mod "version" doesn't match current theme version.
*/
function prefix_update_check() {
$ver = get_theme_mod( 'version', false );
@devinsays
devinsays / combine-menus.php
Created November 13, 2015 18:09
Combines two WordPress menus into one.
<?php
/**
* Combines the markup of two menu areas into one.
*/
// Get the markup list items in the first menu.
$menu = wp_nav_menu( array(
'theme_location'=> 'menu-1',
'fallback_cb' => false,
'container' => '',
@Freekbron
Freekbron / fa-icon-walker.php
Created November 11, 2014 10:07
Font Awesome - WordPress - Custom nav walker
<?php
/**
* Custom nav walker
*
* Custom nav walker to assign icons to menu items.
*/
class FA_Icon_Walker extends Walker_Nav_Menu
{
/**
@gregrickaby
gregrickaby / functions.php
Last active August 29, 2015 14:03
How to create an Author Box using the Gravatar API
<?php
// DO NOT INCLUDE OPENING PHP TAG AND PLACE INTO FUNCTIONS.PHP
/**
* Get Author's Gravatar profile data.
*/
function custom_get_gravatar_profile() {
// Get author data
$author = strtolower( trim( get_the_author_meta( 'email' ) ) );
@staltz
staltz / introrx.md
Last active July 4, 2024 10:11
The introduction to Reactive Programming you've been missing