Skip to content

Instantly share code, notes, and snippets.

View st23am's full-sized avatar

James Smith st23am

  • Adobe / Frame.io
  • Cincinnati
  • X @st23am
View GitHub Profile
defmodule SchemaChecker do
def find_field_discrepancies do
schema_modules()
|> Enum.map(fn mod ->
{mod.__schema__(:source), check_module(mod)}
end)
end
defp schema_modules do
{:ok, modules} = :application.get_key(:core, :modules)
@sorentwo
sorentwo / start_oban_web.livemd
Created July 27, 2022 16:38
Single Page Oban Web

Single Page Oban Web

Application.put_env(:sample, Sample.Repo, database: "oban_dev")

Application.put_env(:phoenix, :json_library, Jason)

Application.put_env(:sample, Sample.Endpoint,
  http: [ip: {127, 0, 0, 1}, port: 5001],
  server: true,
@mcrumm
mcrumm / app.js
Last active April 28, 2023 09:48
flatpickr + LiveView example
// assets/js/app.js
// ...
import Pickr from "./pickr"
const hooks = {
Pickr
}
// ...
@rob-brown
rob-brown / ElixirConf2014.md
Last active December 4, 2020 05:38
Notes from ElixirConf 2014

ElixirConf 2014

Dave Thomas—Opening Keynote

Twitter | Slides

Think different(ly)

Get out of your rut and learn new ways to think.

@ShingoFukuyama
ShingoFukuyama / Font-Awesome-for-Emacs.el
Last active May 3, 2020 11:46
Show Font Awesome icons on Emacs
;; Assume you have already installed Font Awesome on the system
;; http://fortawesome.github.io/Font-Awesome/
(require 'ov)
;; Overlay Library
;; https://github.com/ShingoFukuyama/ov.el
;; Example 1: Insert all fonts at the cursor position
(defun font-awesome-insert-all ()
@tawrahim
tawrahim / vim status line
Created May 11, 2013 16:33
An informative status line in vim
" show little divider at bottom of vim
set laststatus=2
"an informative status line
set statusline=\[%t%m]\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [LINE=%04l,COL=%04v]\ %{GitBranch()}
" Function to display git branch
function! GitBranch()
let branch = system("git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* //'")
@dtakahas
dtakahas / babby.rb
Last active December 28, 2021 03:56
How is babby formed in Rails?
class Babby < PragnentGirl::GetPragnent
attr_accessible :name, :mother, :location, :pragnent_girl_id
belongs_to :pragnent_girl
before_save :destroy_instain_mothers
after_save :pary_for_father
#How is babby formed?
@st23am
st23am / robot3.rb
Created November 20, 2012 23:13
BaselineBot
require 'rrobots'
class Robot3
include Robot
def tick events
@rapid_fire = 0 if @rapid_fire.nil?
@last_seen = 0 if @last_seen.nil?
@turn_speed = 3 if @turn_speed.nil?
if time - @last_seen > 200
@st23am
st23am / 0-readme.md
Created September 11, 2012 00:34 — forked from burke/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

Overview

This script installs a patched version of ruby 1.9.3-p194 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Many thanks to funny-falcon for the performance patches.