Skip to content

Instantly share code, notes, and snippets.

@randomecho
randomecho / australian-postcodes.sql
Last active June 3, 2024 19:24
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
/*
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod
May contain errors where latitude and longitude are off. Use at own non-validated risk.
*/
SET NAMES utf8;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS postcodes_geo;
@BinaryMuse
BinaryMuse / overrides.js
Created September 20, 2014 08:14
setTimeout via Web Worker
var timeoutId = 0;
var timeouts = {};
var worker = new Worker("/static/timeout-worker.js");
worker.addEventListener("message", function(evt) {
var data = evt.data,
id = data.id,
fn = timeouts[id].fn,
args = timeouts[id].args;
@nkbt
nkbt / .eslintrc.js
Last active May 11, 2024 13:03
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@GerardoFurtado
GerardoFurtado / aust.json
Last active April 2, 2024 03:30
Australia map
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Mo3g4u
Mo3g4u / vue2_manual_drag_and_drop.js
Created January 31, 2017 00:11
vue.js 2.0 manual drag drop sample
<h1>User List (sort)</h1>
<p><a href="{{ basePath }}/top">Top</a></p>
<p><a href="{{ basePath }}/user/add">Add</a></p>
<div id="userList">
<table border="1">
<thead>
<tr>
<th>■</th>
@davebeach
davebeach / terms.md
Created June 1, 2017 16:16
Sample Terms and Conditions

Terms Of Use

Table of Contents

  1. Legal Notices
  2. Permitted and Prohibited Uses
  3. User Submissions
  4. User Discussion Lists and Forums
  5. Use of Personally Identifiable Information
  6. Indemnification
@Tiriel
Tiriel / encryption.js
Last active June 21, 2024 07:53
Symetric encryption/decryption for PHP and NodeJS communication
'use strict';
const crypto = require('crypto');
const AES_METHOD = 'aes-256-cbc';
const IV_LENGTH = 16; // For AES, this is always 16, checked with php
const password = 'lbwyBzfgzUIvXZFShJuikaWvLJhIVq36'; // Must be 256 bytes (32 characters)
function encrypt(text, password) {
@anova
anova / sqlpackage.md
Last active November 3, 2022 20:31
Sqlpackage.exe samples

Export

Creates a .bacpac file from live database.

"C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\SqlPackage.exe" /a:Export /scs:"Data Source=SERVER;Initial Catalog=db_name;Integrated Security=False;Persist Security Info=False;User ID=db_user;Password=db_password" /tf:"D:\backup\database_backup.bacpac"

Import

Import from .bacpac file to database.

@chrismccoy
chrismccoy / gutenberg.txt
Last active June 17, 2024 05:41
Gutenberg Resources
How to parse Gutenberg content for headless WordPress
https://kinsta.com/blog/headless-wordpress-gutenberg/
Adding wrapper to Gutenberg’s Table block
https://helloadmin.com/adding-wrapper-to-gutenbergs-table-block/
Display specific Gutenberg blocks of a post outside of the post content in the theme
https://florianbrinkmann.com/en/display-specific-gutenberg-blocks-of-a-post-outside-of-the-post-content-in-the-theme-5620/
Modifying the Markup of a Core Block
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# http://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8