Skip to content

Instantly share code, notes, and snippets.

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

Josef Strzibny strzibny

🏠
Working from home
View GitHub Profile
@kieraneglin
kieraneglin / example_live_test.exs
Last active February 11, 2024 03:44
Pow sessions with LiveView (including tests)
defmodule MyAppWeb.ExampleLiveTest do
# `LiveviewCase` is a custom test helper - pretty much the same as ConnCase but with
# import Phoenix.LiveViewTest
# import MyApp.Support.AuthHelpers
use MyAppWeb.LiveviewCase, async: false
import MyApp.Factory
alias MyApp.Repo
alias MyAppWeb.ExampleLive
@sesopenko
sesopenko / Makefile
Last active May 8, 2021 22:20
Automated, complete dev environment setup for building Phoenix web apps in Ubuntu 20.10 with Docker and MariaDB
LSB_RELEASE := $(shell lsb_release -cs)
WHOAMI := $(shell whoami)
SYSTEM := $(shell uname -s)
ARCH := $(shell uname -m)
NODE_VERSION := 14
PHOENIX_VERSION := 1.5.8
install-nodejs:
cd /tmp/
curl -sL https://deb.nodesource.com/setup_$(NODE_VERSION).x -o nodesource_setup.sh
@prologic
prologic / LearnGoIn5mins.md
Last active April 30, 2024 15:10
Learn Go in ~5mins
@cnicodeme
cnicodeme / fixes.md
Last active November 17, 2023 15:31
List of 5,000 Most Frequently Used Domain Name Prefixes and Suffixes - Ordered By Length
@dillonchanis
dillonchanis / example.css
Created September 20, 2020 14:44
Tailwind Utility for using gradients with text
@layer utilities {
.text-gradient {
background-clip: text;
-webkit-text-fill-color: transparent;
}
}
@GustavoCaso
GustavoCaso / job_scheduler_using_ractor.rb
Last active January 5, 2021 04:30
Simple implementation for a job scheduler using ruby Ractor primitive
# How to install the latests version of ruby
# 1. clone ruby/ruby
# 2. autoconf
# 3. ./configure
# 4. cd ext/openssl && ruby extconf.rb --with-openssl-dir=<openssl_root>; make; make install
# 5. cd ../../
# 6. make
# 7. make install-nodoc
# You should be ready ti run this script!!!!
defmodule StringTrimmer do
def trim_utf8(string, len), do: trim(string, len, &utf8_counter/1)
def trim_utf16(string, len), do: trim(string, len, &utf16_counter/1)
def trim(string, len, counter) do
string
|> String.graphemes()
|> Enum.reduce_while({0, ""}, fn grapheme, {count, acc} ->
count = count + counter.(grapheme)
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@Manzanit0
Manzanit0 / extensions.sh
Last active November 24, 2021 09:02
My personal VS Code configuration
# theming
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension github.github-vscode-theme
# terminal
code --install-extension formulahendry.terminal
code --install-extension msamueltscott.maximizeterminal
# general stuff
code --install-extension vscodevim.vim