Skip to content

Instantly share code, notes, and snippets.

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

Celmaun celmaun

🏠
Working from home
View GitHub Profile
@celmaun
celmaun / docker-etc-hosts-install.sh
Last active December 10, 2024 12:02
Installs docker container names and IP addresses in /etc/hosts https://x.com/Celmaun/status/1866434295805456807
#!/usr/bin/env bash
# vim:set ft=bash ts=4 sw=4 et :
# shellcheck shell=bash
# shellcheck disable=SC2317
## Usage:
## docker-etc-hosts-install
## Installs docker container names and IP addresses in /etc/hosts
## This script is idempotent
## Note: Requires root privileges to write to /etc/hosts
@nuxodin
nuxodin / focusin focusout support for firefox.js
Last active February 7, 2024 16:40
focusin focusout support for firefox
/* Copyright (c) 2016 Tobias Buschor https://goo.gl/gl0mbf | MIT License https://goo.gl/HgajeK */
/* focusin/out event polyfill (firefox) */
!function(){
var w = window,
d = w.document;
if (w.onfocusin === undefined) {
d.addEventListener('focus' ,addPolyfill ,true);
d.addEventListener('blur' ,addPolyfill ,true);
d.addEventListener('focusin' ,removePolyfill ,true);
ALTER TABLE xxxxxx
ADD created_at TIMESTAMP DEFAULT '0000-00-00 00:00:00',
ADD updated_at TIMESTAMP DEFAULT '0000-00-00 00:00:00';
CREATE TRIGGER xxxxxx_create BEFORE INSERT ON `xxxxxx`
FOR EACH ROW SET NEW.created_at = NOW(), NEW.updated_at = NOW();
CREATE TRIGGER xxxxxx_update BEFORE UPDATE ON `xxxxxx`
FOR EACH ROW SET NEW.updated_at = NOW(), NEW.created_at = OLD.created_at;
@paulmillr
paulmillr / dart.md
Last active January 7, 2025 21:10
Leaked internal google dart email

---------- Forwarded message ----------

From: Mark S. Miller <[email protected]>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: [email protected]
<?php
// Quick bug fix for Issue #24837 (http://www.magentocommerce.com/bug-tracking/issue/?issue=10453)
$rootBlock = Mage::app()->getLayout()->getBlock('root');
if ( false !== $rootBlock ) {
foreach ( Mage::getModel('page/config')->getPageLayouts() as $pageLayout ) {