Skip to content

Instantly share code, notes, and snippets.

@kez
kez / alpine-todo.html
Last active Jan 19, 2021
Alpine.js Todo App Demo (with Tailwind). Please feel free to fork and refactor with improvements! Motivation/details here https://www.kdobson.net/2020/alpine-js-todo-demo/)
View alpine-todo.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Alpine.js Todo Demo</title>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.js" defer></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tailwindcss/ui@latest/dist/tailwind-ui.min.css">
<meta charset="utf-8">
</head>
@kez
kez / slugify.sql
Created May 13, 2019 — forked from ianks/slugify.sql
Generating Slugs in Postgres
View slugify.sql
CREATE EXTENSION IF NOT EXISTS "unaccent"
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"lowercase" AS (
@kez
kez / xvfb
Created Mar 13, 2012 — forked from dmitriy-kiriyenko/console
Init.d to start/stop xvfb. Put it into /etc/init.d and chmod it to 755
View xvfb
### BEGIN INIT INFO
# Provides: Xvfb
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
XVFB=/usr/bin/Xvfb
XVFBARGS=":0 -screen 0 1024x768x24 -fbdir /var/run -ac"
@kez
kez / sall.js
Created Sep 8, 2011
Super Amazon Link Localizer Javascript
View sall.js
<script type="text/javascript">
var sAccessKey = "XXX";
var hTags = {
'com': 'salldefault-20',
'co.uk': 'salldefault-21',
'de': 'salldefault-de-21',
// fr, jp, it, ca, cn
};
</script>
@kez
kez / super-amazon-link-localizer-javascript-embed-code.js
Created Sep 5, 2011
Super Amazon Link Localizer Javascript Embed Code
View super-amazon-link-localizer-javascript-embed-code.js
View jekyll tag pages
@@site_url = 'http://www.mysite.com'
task :cloud_basic do
puts 'Generating tag cloud...'
require 'rubygems'
require 'jekyll'
include Jekyll::Filters
options = Jekyll.configuration({})
site = Jekyll::Site.new(options)
View jekyll-create-tag-cloud-rakefile.rb
puts 'Generating tag cloud...'
require 'rubygems'
require 'jekyll'
include Jekyll::Filters
options = Jekyll.configuration({})
site = Jekyll::Site.new(options)
site.read_posts('')
View jekyll-create-tag-pages-rakefile.rb
desc 'Generate tags page'
task :tags do
puts "Generating tags..."
require 'rubygems'
require 'jekyll'
include Jekyll::Filters
options = Jekyll.configuration({})
site = Jekyll::Site.new(options)
site.read_posts('')