Skip to content

Instantly share code, notes, and snippets.

View artworx's full-sized avatar

Alexandru Keszeg artworx

View GitHub Profile
@artworx
artworx / uuid_time_nextval.sql
Created January 23, 2021 10:20 — forked from Tostino/uuid_time_nextval.sql
PL/PGSQL Function for uuid_time_nextval
CREATE FUNCTION uuid_time_nextval(interval_length int default 60, interval_count int default 65536)
RETURNS uuid
LANGUAGE plpgsql
AS $$
DECLARE
v_i int;
v_prefix_bytes int = 0;
v_time bigint;
v_bytes int[16] = '{}';
v_hex text[16] = '{}';

Keybase proof

I hereby claim:

  • I am artworx on github.
  • I am artworx (https://keybase.io/artworx) on keybase.
  • I have a public key ASD8t5rB0R2lBAiQGiopySaXre0HHCQvRp3l06drapT03go

To claim this, I am signing this object:

set visualbell
set noerrorbells
set ignorecase
let mapleader=","
imap jj <ESC>
nnoremap <leader>r :action RenameElement<CR>
nnoremap <leader>a :action GotoRelated<CR>
@artworx
artworx / 0_reuse_code.js
Created May 9, 2016 07:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@artworx
artworx / api_paginate.rb
Last active August 29, 2015 14:14
rails pagination headers
module ApiPagination
protected
def api_paginate(collection, options = {})
links = (headers['Link'] || "").split(',').map(&:strip)
url = request.original_url.sub(/\?.*$/, '')
pages = pages_from(collection)
pages.each do |k, v|
new_params = request.query_parameters.merge(:page => v)
# encoding : utf-8
require 'openssl'
require 'digest/sha1'
require 'base64'
module Aws
extend self
def signed_url(path, expire_date)
digest = OpenSSL::Digest::Digest.new('sha1')
can_string = "GET\n\n\n#{expire_date}\n/#{S3_BUCKET}/#{path}"
require 'spec_helper'
class Crazy < Drivy::Service
attribute :starts_at_date, String
attribute :previous_rental_id, Integer
def test
ap starts_at_date
if previous_rental_id.present?