Skip to content

Instantly share code, notes, and snippets.

View kdawgwilk's full-sized avatar
🐘
Technical Co-founder @ AskElephant

Kaden Wilkinson kdawgwilk

🐘
Technical Co-founder @ AskElephant
View GitHub Profile
@atomkirk
atomkirk / cloud-files.md
Last active January 18, 2023 17:23
Storing files on S3 with Elixir

I have this abstraction in my application code called a "CloudFile". This is where I store in the database information about files on S3 and it gives me a resource for other resources to own. For example, a user would have an avatar_cloud_file_id. On the front-end, I would load this relationship and display the avatar with user.avatar_cloud_file.download_url

defmodule RL.CloudFile do
  use Ecto.Schema
  import Ecto.Changeset

  @timestamps_opts type: :utc_datetime_usec
@laynemoseley
laynemoseley / deploy.sh
Last active October 1, 2019 19:16
Zork deploy script
#!/bin/bash
echo "You enter a dark dungeon. A sign in front of you says: Choose wisely or you'll probably die."
read -p 'staging or production: ' ENV
if [ $ENV != "staging" ] && [ $ENV != "production" ]
then
echo "You go into the wrong hallway, a skeleton comes out and decapitates you. The End."
exit 1
fi
@inamiy
inamiy / SwiftElmFrameworkList.md
Last active March 11, 2024 10:20
React & Elm inspired frameworks in Swift
@harlanhaskins
harlanhaskins / Lexer.swift
Last active March 4, 2023 20:10
Building a Compiler in Swift with LLVM, Part 1: Introduction and the Lexer
#if os(macOS)
import Darwin
#elseif os(Linux)
import Glibc
#endif
enum BinaryOperator: Character {
case plus = "+"
case minus = "-"
case times = "*"
@skreutzberger
skreutzberger / sen_swiftbe_dev.md
Last active December 2, 2019 15:07
Senior Swift Backend Developer (Freelance, 100% Remote)

Senior Swift Backend Developer (Freelance, 100% Remote)

I am searching experienced backend developers (freelance, remote) with a ❤️ for Swift for Moonshot Energy, the world’s first AI-driven renewable energy company located in Germany. Moonshot Energy is financially backed by Innogy SE, one of Europe's largest energy providers.

At Moonshot you will play a major role in making the world greener, the future brighter and energy distribution smarter by using latest technologies like server-side Swift, microservices, artificial intelligence 🤖 and machine learning and new interfaces like chatbots and dialog-based systems (NLP).

Since our team is working on European timezones it would be good if you would live in the EU or if you are an early bird living in US-East 🇪🇺🇺🇸.

Your job:

  • build our internal microservices
@harlanhaskins
harlanhaskins / trace.swift
Created October 6, 2016 17:50
Pure Swift stack trace
struct StackFrame {
let symbol: String
let file: String
let address: UInt64
let symbolAddress: UInt64
var demangledSymbol: String {
return _stdlib_demangleName(symbol)
}
}
@wess
wess / Makefile
Last active February 24, 2018 03:16
Makefile for Vapor using Watchman to restart on change.
all: build run
clean:
@vapor clean
build:
@vapor build
run:
@JaviSoto
JaviSoto / SampleViewController.swift
Last active January 23, 2020 09:20
Init based Storyboard View Controller Instantiation
final class SampleViewController: StoryboardBackedViewController {
// Unfortunately this must be an IUO var, so that we can set the value after super.init
private var member: Foo!
// Proper dependency injection in a storyboard backed VC!
init(foo: Foo) {
super.init(storyboardIdentifier: "SampleViewControllerIdentifier")
// We have to set the members *after* calling super.init, since it changes the instance of `self`.
self.member = foo
@burnsra
burnsra / pre-commit
Created March 3, 2016 23:40
Reserved word pre-commit hook
# Instructions:
# Put this file into your ~/.git-templates/hooks folder and set as executable (chmod +x pre-commit)
# If you want to skip the hook just add --no-verify as follows: git commit --no-verify
# ---------------------------------------------
#!/bin/sh
RESERVED_LIST="alert(\|console.log(\|USERNAME"
/*
ericasadun.com
Super-basic priority-less layout utilities
*/
#if os(iOS)
import UIKit
#else