This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orm_model! { | |
table = "admins"; | |
fields = { | |
*id: i64, | |
company_id: i64, | |
name: String, | |
email: String, | |
password: Password, | |
password_reset_token: Option<String>, | |
created_at: DateTime, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub enum FormError { | |
UniqueViolation, | |
LengthRange(u32, u32), | |
} | |
// impl MyError for FormError { ... } | |
#[derive(Deserialize)] | |
pub struct SignupData { | |
username: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "car_demo" | |
version = "0.0.1" | |
[dependencies] | |
iron = "*" | |
router = "*" | |
urlencoded = "*" |