Skip to content

Instantly share code, notes, and snippets.

View collegeimprovements's full-sized avatar
💭
☀️

Arpit Shah collegeimprovements

💭
☀️
View GitHub Profile
This file has been truncated, but you can view the full file.
[
{
"productName": "(PEA)+ 120 Capsules",
"sku": "000000000300089862",
"medPaxSku": "",
"medPaxDetails": null,
"categories": "Immune System Support,Joint & Muscle Support,All",
"quantity": 80,
"releaseDate": "2022-05-01T15:00:07.7866667",
"wholesalePrice": 46.9900,
@collegeimprovements
collegeimprovements / init_backup.lua
Created April 10, 2022 05:11
[Nvim] init.lua backup
require "paq" {
"savq/paq-nvim",
-- Let Paq manage itself
-- libs
"tjdevries/nlua.nvim",
"nvim-lua/plenary.nvim",
"nvim-lua/popup.nvim",
"rktjmp/lush.nvim",
"tjdevries/colorbuddy.vim",
-- tools
@collegeimprovements
collegeimprovements / big-o.md
Created November 26, 2021 16:13 — forked from PJUllrich/big-o.md
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for < 32 elements, O(log n) for >= 32 elements [2]
Deletion O(n) for < 32 elements, O(log n) for >= 32 elements
# TODO: Extract into it's own library
defmodule AbsintheSocket do
require Logger
alias Phoenix.Channels.GenSocketClient
@behaviour GenSocketClient
@control_topic "__absinthe__:control"
defdelegate fetch(term, key), to: Map
defdelegate get(term, key, default), to: Map
@collegeimprovements
collegeimprovements / neovim-setup.md
Created July 14, 2021 18:13 — forked from adamzaninovich/neovim-setup.md
How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

Example

Installing neovim

brew install neovim/neovim/neovim
import "../css/app.scss"
import "phoenix_html"
import {Socket} from "phoenix"
import topbar from "topbar"
import {LiveSocket} from "phoenix_live_view"
import Alpine from 'alpinejs'
window.Alpine = Alpine
Alpine.start()
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
@collegeimprovements
collegeimprovements / foo.ex
Created May 26, 2021 15:37 — forked from 0x6a68/foo.ex
Spec to Callback
defmodule MyApp.Foo do
@on_definition MyApp.SpecToCallback
@spec bar(String.t()) :: String.t()
def bar(foobar) do
impl().bar(foobar)
end
defp impl, do: Application.get_env(:my_app, :my_app_foo_impl, __MODULE__.DefaultImpl)
end
@collegeimprovements
collegeimprovements / with_example.ex
Created February 9, 2020 05:15 — forked from devonestes/with_example.ex
Further refactoring of a with statement
# Step 1
def create_subscription(email, plan_id, payment_method_id) do
with %User{customer_id: nil, name: name} = user <-
Repo.get_by(User, email: email),
{:ok, %Stripe.Customer{id: customer_id}} <-
Stripe.Customer.create(%{
name: name,
email: email,
payment_method: payment_method_id,
@collegeimprovements
collegeimprovements / 2019-https-localhost.md
Created February 5, 2020 12:23 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

{
"workbench.colorTheme": "Noctis",
"window.zoomLevel": 0,
"files.autoSave": "onFocusChange",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"spellright.language": [
"en"
],
"spellright.documentTypes": [