Skip to content

Instantly share code, notes, and snippets.

View konung's full-sized avatar
💭
💙💛

Nick Gorbikoff konung

💭
💙💛
View GitHub Profile
@konung
konung / fedex_track.json
Created October 15, 2023 23:00
Fedex Track API
{
"openapi": "3.0.0",
"servers": [
{
"url": "https://apis-sandbox.fedex.com",
"description": "Sandbox Server"
},
{
"url": "https://apis.fedex.com",
"description": "Production Server"
@konung
konung / fly.toml
Created March 2, 2023 16:42 — forked from dNitza/fly.toml
Hanami 2.0 fly.io config
app = "app-name"
kill_signal = "SIGINT"
kill_timeout = 5
[deploy]
release_command = "bin/hanami db migrate"
[env]
HANAMI_ENV="production"
@konung
konung / app.DockerFile
Created February 5, 2023 21:41 — forked from satendra02/app.DockerFile
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran:
@konung
konung / 1 Setup vps.md
Created February 5, 2023 21:38 — forked from deHelden/"torn" 1 Setup vps.md
Deploy Rails 6.0.0 to VPS(DigitalOcean Ubuntu 19). Nginx, Puma, Capistrano3, PostgreSQL, Rbenv.

SETUP VPS

based on DigitalOcean guide

Create local project

local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
@konung
konung / autofs.md
Created October 20, 2022 20:06 — forked from rudelm/autofs.md
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file /etc/auto_master and add the last line:

#
# Automounter master map
#

+auto_master # Use directory service

$Path = 'i:\'
$OutCSV = 'c:\Windows\Temp\i_drive_suspects.csv'
$RegEx = "[^-\w\.\ \~\'\(\)\$\&\+\,\@\%]" # This matches anything that isn't a-z, A-Z, 0-9, or the '-', '_', and '.' characters. Add any others you need to permit.
$Output = Get-ChildItem -Path $Path -Recurse | Where-Object -FilterScript { $_.Name -match $RegEx } | ForEach-Object {
$out = [PSCustomObject]@{ # Note: add any additional inforamtion you want to caputure here
Name = $_.Name
FullPath = $Path
Path = (Split-Path -Path $_.FullName)
@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

@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 / 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 / .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: