Skip to content

Instantly share code, notes, and snippets.

View konung's full-sized avatar
💭
💙💛

Nick Gorbikoff konung

💭
💙💛
View GitHub Profile
@skojin
skojin / Dockerfile
Last active May 5, 2020 12:35
Dockerfile for http://luckyframework.org deployment
FROM crystallang/crystal:0.34.0 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_12.x | bash - \
&& apt-get install -y nodejs
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
@jwoertink
jwoertink / 00_notes.txt
Last active February 15, 2019 05:33
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
@ManzDev
ManzDev / rollup.config.js
Created February 24, 2018 17:13
RollUp Config file for easy ES6 to ES5 bundle
import babel from 'rollup-plugin-babel';
import eslint from 'rollup-plugin-eslint';
import resolve from 'rollup-plugin-node-resolve';
import multiEntry from 'rollup-plugin-multi-entry';
import uglify from 'rollup-plugin-uglify';
import filesize from 'rollup-plugin-filesize';
import commonjs from 'rollup-plugin-commonjs';
import progress from 'rollup-plugin-progress';
let pluginOptions = [
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
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 
@djinn
djinn / Shopify.Oauth.ex
Last active January 21, 2017 21:00
Shopify Oauth strategy for Elixir
defmodule Shopify.Oauth do
@moduledoc """
An OAuth2 strategy for Shopify.
Based on the OAuth2 strategy for GitHub by Sonny Scroggin
in https://github.com/scrogson/oauth2_example
"""
use OAuth2.Strategy
alias OAuth2.Strategy.AuthCode
alias OAuth2.Request
@samsolomon
samsolomon / Create Random Number in Liquid
Last active September 30, 2019 02:52
This code will work to give you a random number to use in Liquid. Works in customer.io.
<!--create a semi-random number using the last second of the send date-->
{% capture time_seed %}
{{ 'now' | date: "%s" }}
{% endcapture %}
<!--manupulate using lots of maths-->
{% assign random = time_seed | times: 1103515245 | plus: 12345 | divided_by: 65536 | modulo: 32768 | modulo: 10 %}
<!--return number-->
{{ random }}
@konung
konung / Rakefile
Last active August 29, 2015 14:18 — forked from robhurring/Rakefile
task :environment do
require './dj-sinatra'
end
namespace :jobs do
desc "Clear the delayed_job queue."
task :clear => :environment do
Delayed::Job.delete_all
end
@v1nc3ntlaw
v1nc3ntlaw / rbenv-install-system-wide.sh
Last active July 26, 2022 01:08
rbenv install ruby 1.9.3-p448 on Debian 6 Squeeze
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl libssl-dev \
libreadline5 libreadline5-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
anonymous
anonymous / zbarrubyexample.rb
Created August 15, 2011 13:09
Using Zbar barcode reader command line with Ruby
def self.read_barcode_from_image path
# Call the barcode reader - and get a response of multiple lines
ls = `/usr/bin/zbarimg '#{path}'`.lines
# Handle a variety of unexpected responses that we have seen and debugged quickly over time
ls = [ls] if ls.is_a?(String)
barcodes = []
return barcodes if ls.nil? || ls == 0