Skip to content

Instantly share code, notes, and snippets.

View stefanvermaas's full-sized avatar
👨‍💻

Stefan Vermaas stefanvermaas

👨‍💻
View GitHub Profile
@stefanvermaas
stefanvermaas / application.css
Created December 28, 2023 00:01
Structuring CSS
@charset 'utf-8';
/*------------------------------------*\
Application Stylesheet
\*------------------------------------*/
/**
* NOTE It's worth noting that most guidelines for writing good CSS and SCSS is
* borrowed of two different guidelines. For more information, see our code
* or take a look at the guidelines:
@stefanvermaas
stefanvermaas / temporary_lock.rb
Last active August 4, 2022 17:36 — forked from ikzekly/temporary_lock.rb
Provides Redis distributed lock api
# frozen_string_literal: true
# @example provides Redis distributed lock api
#
# $ TemporaryLock.create!(:example, 'c22a0420-51c8-4e47-843c-92a37e8d2eba')
# => #<TemporaryLock:0x000055b43e328410 @key="temporary_lock:example:c22a0420-51c8-4e47-843c-92a37e8d2eba">
#
# @example raises `TemporaryLock::StaleObjectError` when `id` already registered
#
# $ TemporaryLock.create!(:example, 'c22a0420-51c8-4e47-843c-92a37e8d2eba')
@stefanvermaas
stefanvermaas / Dockerfile.deploy
Last active June 11, 2022 14:44
A Dockerfile to automatically deploy a Bridgetown site to Digital Ocean's App Platform
FROM ruby:3.1.2-slim-buster
# Install dependencies
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
build-essential \
gnupg2 \
curl \
less \
git \
@stefanvermaas
stefanvermaas / keybase.md
Created January 2, 2021 12:05
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.progress {
position: absolute;
top: 0;
left: 0;

Keybase proof

I hereby claim:

  • I am stefanvermaas on github.
  • I am stefanvermaas (https://keybase.io/stefanvermaas) on keybase.
  • I have a public key whose fingerprint is F994 7F3B F2FC BC6D EE28 313D EC32 F8C4 1BE2 9D9E

To claim this, I am signing this object:

@stefanvermaas
stefanvermaas / appearance-right.rb
Created November 28, 2013 09:49
Ruby Motion compiler error.
Teacup::Appearance.new do
style UINavigationBar,
barTintColor: '#ffffff'.uicolor,
tintColor: '#ffffff'.uicolor,
titleTextAttributes: {
UITextAttributeTextColor => '#ffffff'.uicolor
}
end
@stefanvermaas
stefanvermaas / app_delegate.rb
Last active March 31, 2016 00:54
To synchronize data between a RubyMotion app and a Rails API I needed a sort of a synchronization helper. This code is a proof of concept for this synchronization helper. It uses RubyMotion and BubbleWrap.
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
# For unit testing the application
return true if RUBYMOTION_ENV == 'test'
# Get the frame for the window
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
# Load all the data from the API