Skip to content

Instantly share code, notes, and snippets.

View ignacy's full-sized avatar
🦆
duck typing

Ignacy Moryc ignacy

🦆
duck typing
View GitHub Profile
@ignacy
ignacy / ruby_on_rails_deployment.md
Created December 30, 2022 07:47 — forked from zentetsukenz/ruby_on_rails_deployment.md
Deploy Ruby on Rails application with Docker Compose and Capistrano with ease

Docker

Files and Folders.

|
|\_ app
|...
|\_ docker
| |
@ignacy
ignacy / gist:46e812e45a94f314af2835f1af69b69d
Created June 23, 2022 11:51
Kafka Consumer Group Seek to a timestamp
kafka-consumer-groups \
--bootstrap-server localhost:9092 \
--topic getting-started:2 --group vcs-1 \
--reset-offsets --to-datetime 2022-01-27T14:35:54.528+11:00 \
--execute
@ignacy
ignacy / suffixArray.py
Created February 12, 2021 19:33
Build a suffix array from string
#!/usr/bin/env python3
import sys
from operator import itemgetter
input = sys.stdin.readline
def insr():
s = input()
return(list(s[:len(s) - 1]))
@ignacy
ignacy / pl-colemak.json
Created January 4, 2021 12:23 — forked from 39aldo39/pl-colemak.json
Polish Colemak
{
"fullName": "Polish (Colemak)",
"name": "pl-colemak",
"singletonKeys": [
[ "Alt_R", "AltGr" ]
],
"shiftstates": [ "None", "Shift", "AltGr", "Shift+AltGr" ],
"keys": [
{ "pos": "~", "letters": [ "`", "~", "tilde", "~" ] },
{ "pos": "1", "letters": [ "1", "!", "¡", "¹" ] },
@ignacy
ignacy / cloudSettings
Last active November 23, 2019 11:04
A ZSH function using FZF to fuzzy find pod to connect to and run sh on
{"lastUpload":"2019-11-23T11:07:01.827Z","extensionVersion":"v3.4.3"}
;;;; raytracer.lisp
(in-package #:raytracer)
(defun sq (x) (* x x))
(defun mag (x y z)
(sqrt (+ (sq x) (sq y) (sq z))))
(defun unit-vector (x y z)
(let ((d (mag x y z)))
@ignacy
ignacy / hash_table.go
Created November 24, 2016 18:16
Hash table with chaining for collision resolution
package hash_table
type Node struct {
key string
value int
next *Node
}
// HashTable implements hash table with chaining as colision
// resolution technique
@ignacy
ignacy / rubocop_pre_commit_hook
Created August 18, 2016 06:37 — forked from mpeteuil/rubocop_pre_commit_hook
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/usr/bin/env ruby
require 'english'
require 'rubocop'
ADDED_OR_MODIFIED = /A|AM|^M/.freeze
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
@ignacy
ignacy / async_no_link.ex
Created March 15, 2016 10:51
Example of using Task.Supervisor.async_nolink with Elixir Tasks
@ignacy
ignacy / factory.rb
Created February 4, 2016 07:17
rozwiazanko
require 'factory_boy/factory'
require 'factory_boy/errors'
require 'factory_boy/factory_identifier'
require 'factory_boy/factory_register'
module FactoryBoy
@defined_factories = FactoryRegister.new
def self.clear_factories
@defined_factories = FactoryRegister.new