Skip to content

Instantly share code, notes, and snippets.

View konung's full-sized avatar
๐Ÿ’ญ
๐Ÿ’™๐Ÿ’›

Nick Gorbikoff konung

๐Ÿ’ญ
๐Ÿ’™๐Ÿ’›
View GitHub Profile
module Shopify.Product.Model where
type alias Product =
{ created_at : String,
id : Int,
product_type : String,
published_at : String,
published_scope : String,
title : String,
updated_at : String,
@konung
konung / gource.sh
Created March 13, 2018 00:01
Gource
gource -1280x720 -s 0.01 --max-file-lag 0.1 --auto-skip-seconds 0.25 --user-image-dir ./avatar --hide progress,filenames,dirnames,mouse --date-format "%Y-%m-%d" --multi-sampling --bloom-multiplier 0.4 --bloom-intensity 0.8 --user-scale 1 --max-user-speed 50 --file-idle-time 0 --key --font-size 25 --title "Cell Commits" --font-colour FF0000 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 8 -bf 0 gource_cell_commits.mp4
# And, to activate, you need to tell Rails to load it up:
# config/application.rb
config.middleware.insert_before 0, Rack::Attack
@konung
konung / README.md
Last active July 26, 2018 23:31 — forked from jonathantneal/README.md
SASS @font-face mixin

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@konung
konung / 00_notes.txt
Created February 15, 2019 05:33 — forked from jwoertink/00_notes.txt
Our production deployment setup for deploying Lucky on to Elastic Beanstalk in production.
We develop locally on MacOS. Due to some issues with cross compilation, we build the crystal binary on docker locally,
then zip that up and ship that along with the docker stuff to elasticbeanstalk.
FROM crystallang/crystal:0.27.2
WORKDIR /opt/src
# Install nodejs
COPY bin ./bin
RUN bin/nodesource_11.x
RUN apt-get update && apt-get install -y nodejs
# npm install
@konung
konung / .rubocop.yml
Created March 10, 2019 10:04 — forked from jhass/.rubocop.yml
My preferred Rubocop config
AllCops:
RunRailsCops: true
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
@konung
konung / Dockerfile
Created April 6, 2019 22:45 — forked from skojin/Dockerfile
Dockerfile for http://luckyframework.org deployment
FROM crystallang/crystal:0.27.2 as builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential \
apt-transport-https curl ca-certificates gnupg2 apt-utils
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
@konung
konung / clean-up-boot-partition-ubuntu.md
Created May 5, 2020 19:45 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@konung
konung / 01-truthy-and-falsey-ruby.md
Created January 19, 2021 20:57 — forked from jfarmer/01-truthy-and-falsey-ruby.md
True and False vs. "Truthy" and "Falsey" (or "Falsy") in Ruby, Python, and JavaScript

true and false vs. "truthy" and "falsey" (or "falsy") in Ruby, Python, and JavaScript

Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true and false. In Python, for example, they're written as True and False. But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.).

This outlines how this works in Ruby, with some basic examples from Python and JavaScript, too. The idea is much more general than any of these specific languages, though. It's really a question of how the people designing a programming language wants booleans and conditionals to work.

If you want to use or share this material, please see the license file, below.

Update