Skip to content

Instantly share code, notes, and snippets.

kez

  • London
Block or report user

Report or block kez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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('')
You can’t perform that action at this time.