Skip to content

Instantly share code, notes, and snippets.

" Text editing
set encoding=utf-8
set tabstop=2
set shiftwidth=2
set expandtab
set autoindent
set backspace=indent,eol,start
set fileformat=unix
set fileformats=unix,dos
# Generated by Powerlevel10k configuration wizard on 2022-02-22 at 22:44 PST.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 52170.
# Wizard options: awesome-fontconfig + powerline, small icons, classic, unicode,
# darkest, 12h time, angled separators, sharp heads, sharp tails, 2 lines, solid,
# full frame, sparse, few icons, concise, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
# your own config based on it.
#
@SkylerLipthay
SkylerLipthay / LICENSE.txt
Last active May 29, 2024 10:55
Prevent self-referential foreign key cycles in PostgreSQL
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
use orm::Error;
use orm::model::{Deserialize, Field, Model, Serialize};
use orm_ext::{
CreatedAt, Timestamps, ValidateLength, ValidatePresence, ValidateUniqueness, ValidateZipCode
};
use rand::{thread_rng, Rng};
use serde::ser::{MapVisitor, Serializer};
use values::{DateTime, Password};
orm_model! {
@SkylerLipthay
SkylerLipthay / mithril-patch.js
Created February 8, 2016 12:50
Mithril serialization patch
// Recursively traverses any object or array of objects and converts object
// keys from under_score to camelCase.
function camelize(object) { /* ... */ }
// Recursively traverses any object or array of objects and converts object
// keys from camelCase to under_score.
function underscore(object) { /* ... */ }
// Accepts Mithril's `m` object and Decorates the `m.request` function to
// deserialize using the `camelize` function and to serialize using the
orm_model! {
table = "admins";
fields = {
*id: i64,
company_id: i64,
name: String,
email: String,
password: Password,
password_reset_token: Option<String>,
created_at: DateTime,
pub enum FormError {
UniqueViolation,
LengthRange(u32, u32),
}
// impl MyError for FormError { ... }
#[derive(Deserialize)]
pub struct SignupData {
username: String,
@SkylerLipthay
SkylerLipthay / sorry_fontspring.rb
Last active August 29, 2015 14:23
Fontspring WOFF downloader
require 'nokogiri'
require 'open-uri'
require 'base64'
url = ARGV[0]
abort 'Supply a Fontspring URL' if url.nil?
page = Nokogiri::HTML(open(url)) rescue nil
abort 'Fontspring URL is invalid' if page.nil?
faces = page.css('#ffdemo_select option').to_a
abort 'No fonts faces found' if faces.empty?
@SkylerLipthay
SkylerLipthay / Cargo.toml
Last active August 29, 2015 14:22
Iron demo
[package]
name = "car_demo"
version = "0.0.1"
[dependencies]
iron = "*"
router = "*"
urlencoded = "*"