Skip to content

Instantly share code, notes, and snippets.

View andreyuhai's full-sized avatar
🏠
Working from home

Burak andreyuhai

🏠
Working from home
View GitHub Profile
@Venryx
Venryx / Fractional Indexing (David Greenspan).md
Last active December 28, 2024 00:25
List of various fractional-indexing schemes, along with language-specific implementations
@havenwood
havenwood / connection.rb
Created July 7, 2020 01:17
An example HTTP gem connection pool extracted from some of my code for #ruby IRC
@executor = Concurrent::ThreadPoolExecutor.new min_threads: min_threads,
max_threads: max_threads
def connection_pool
@connection_pool ||= ConnectionPool.new size: @pool_size, timeout: @pool_timeout do
HTTP.auth("Bearer #{access_token}")
.persistent(HOST)
.timeout(@http_timeout)
.headers(accept_encoding: ACCEPT_ENCODING)
.use(:auto_inflate)
@wbednarski
wbednarski / rename_phoenix_project.sh
Last active April 7, 2025 08:40 — forked from krystofbe/rename_phoenix_project.sh
rename a phoenix 1.3 project
#!/bin/bash
set -e
CURRENT_NAME="Zauberantrag"
CURRENT_OTP="zauberantrag"
NEW_NAME="Wunderantrag"
NEW_OTP="wunderantrag"
@ServerlessBot
ServerlessBot / IAMCredentials.json
Last active February 24, 2025 15:51
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 3, 2025 11:23
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@isurum
isurum / ProductsController.php
Created July 18, 2017 12:33
Laravel 5.4 Bootstrap row class for every 3 columns - Blade Template
public function showProducts(){
$products = DB::table('products')->paginate(9);
return view('products', ['products' => $products]);
}
@baweaver
baweaver / ruby_books.md
Last active April 11, 2025 11:21
A list of books for learning and expanding on your Ruby knowledge.

Ruby Book List

Learning Ruby

You're taking your first steps into Ruby

A good introduction to programming in general. Easy on newer programmers.

@Tset-Noitamotua
Tset-Noitamotua / .vimrc
Last active April 30, 2025 23:34
Powerline Setup for my VIM
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
" "
" __ _ _ _ __ ___ _ __ ___ "
" \ \ / / | '_ ` _ \| '__/ __| "
" \ V /| | | | | | | | | (__ "
" \_/ |_|_| |_| |_|_| \___| "
" "
" "
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
# lazyload nvm
# all props goes to http://broken-by.me/lazy-load-nvm/
# grabbed from reddit @ https://www.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/
lazynvm() {
unset -f nvm node npm npx
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
if [ -f "$NVM_DIR/bash_completion" ]; then
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
@havenwood
havenwood / procs_blocks_and_lambdas.rb
Last active January 12, 2022 22:06
A few examples of Ruby's procs, blocks and lambdas (irc question)
def meth &block
block
end
block = meth { 42 }
prok = proc { 42 }
lamb = lambda { 42 }
block.call
#=> 42
prok.call