Skip to content

Instantly share code, notes, and snippets.

View suhovius's full-sized avatar
🤘
Metal

Suhovius suhovius

🤘
Metal
View GitHub Profile
Please listen up!
I need assistance with preparation for coding session
The CodeSignal screen is meant to test general coding ability.
I’ll be asked to implement a simple coding project from a spec and develop it to the point that it passes some tests.
I should prioritize
a) writing code that passes as many tests as possible and
b) progressing through all four levels quickly.
It'll essentially be a toy simulation of an app that won't require anything except the standard library of chosen programming language.
Note there's no framework/UI or anything similar — basically, it's like the core business logic of an app, but nothing else.
It won’t test detailed knowledge of algorithms, compute systems, or machine learning.
@yokawasa
yokawasa / ghcr.md
Last active October 14, 2024 13:38
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart

CLI

To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

@avoidik
avoidik / curl.sh
Last active August 10, 2024 17:12
Use curl instead of kubectl
#!/bin/bash
#
# download yq
#
curl -fsSL https://github.com/mikefarah/yq/releases/download/v4.43.1/yq_linux_amd64 -o /usr/local/bin/yq
chmod +x /usr/local/bin/yq
#
@thlinux1107
thlinux1107 / main.rb
Created April 22, 2020 16:27
Paya Connect - AccountForm - CC. ACH Works the same way.
# /*----------------------------------------------
# Author: SDK Support Group
# Company: Paya
# Contact: [email protected]
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# !!! Samples intended for educational use only!!!
# !!! Not intended for production !!!
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# -----------------------------------------------*/
@ntamvl
ntamvl / create-ruby-gem-that-adds-rake-tasks.md
Last active November 12, 2024 19:35
How to create a Ruby gem that adds Rake tasks

How to create a Ruby gem that adds Rake tasks

Create a gem

One way to do this is to use bundler to scaffold our gem:

bundler gem my_gem

Add rake tasks to our gem

I prefer to put tasks meant to manage the gem itself in lib/tasks, and tasks the gem is meant to provide to gem users in lib/my_gem/tasks.

@worldofprasanna
worldofprasanna / terminal-capture.md
Last active October 16, 2024 14:41
Multiple screen terminal capture using asciinema & tmux

Commands Reference

  1. Start a new tmux named session tmux new -s terminal-capture
  2. Split the screen using these commands,
  • vertical split <C-b>"
  • horizontal split <C-b>%
  1. To navigate between the panes,
  • To goto Left pane <C-b> left-key
  • To goto Right pane <C-b> right-key
  • To goto Top pane up-key
@ForeverZer0
ForeverZer0 / extconfig.rb
Created October 3, 2018 18:42
Automatically include/compile all Ruby C extension source files (including subdirectories) using mkmf
require "mkmf"
ext_name = 'my_extension'
excluded = ['x86', 'x64']
dir_config(ext_name)
$srcs = Dir.glob("#{$srcdir}/**/*.c").map { |path| File.basename(path) }
Dir.glob("#{$srcdir}/*/") do |path|
dir = File.basename(path)
@glv
glv / regexp_syntax.md
Last active November 1, 2024 18:55
Ruby and PostgreSQL Regular Expressions

Ruby and Postgres Regular Expression Syntaxes

Ruby's regular expressions are unusually powerful. Postgres' regular expressions are not as powerful, but they come close; close enough that it's possible to do many pattern-based queries and string transformations entirely in a query.

And sometimes, it's very useful to have a single regular expression that works

@Aetherus
Aetherus / scale-out-phoenix-with-websocket.md
Last active February 23, 2024 14:31
How to scale out a Phoenix application with websocket

How to scale out a Phoenix application with websocket

Foreword

It's relatively easy to scale out stateless web applications. You often only need a reverse proxy. But for those stateful web applications, especially those applications that embeds websocket services in them, it's always a pain to distribute them in a cluster. The traditional way is introducing some external services like Redis to handle pubsub, however, in such way, you often need to change your code. Can Erlang/Elixir, the "concurrency oriented programming languages", best other languages in this use case? Has Phoenix framework already integrated the solution of horizontally scaling websocket? I'll do an experiment to prove (or disprove) that.

Resources