Skip to content

Instantly share code, notes, and snippets.

View chanced's full-sized avatar

Chance chanced

  • Columbia, SC, USA
View GitHub Profile
%ul#addresses
-each address in agency.addresses
%li
%ul
-inputName = 'agency[addresses]['+address._id+']'
%li
%label{for: inputName + '[name]'}
Name
%input{type: "text", name: inputName + "[name]", value: address.name}
%li
form(method = "post", action = "/agencies")
input(type = "hidden", name = "csrf", value = "csrf")
label Name
input( type = "text", name = "agency[name]", value= agency.name? agency.name = "")
label Type
select( name = "agency[type]")
option(value= '', selected = (agency.type == '')) Select Agency Type
option(value= 'medical', selected= (agency.type =='medical')) Medical Service
option(value= 'disasterService', selected= (agency.type=='disasterService')) Disaster Service
option(value= 'local-law', selected= (agency.type=='local-law')) Law Enforcement, Local
require('./db_connect');
var geocoder = require('geocoder');
var cs = require('../cyberstride/mongoose');
var AddressSchema = new Schema({
name : {type: String, default : ''},
street1 : {type: String, default : ''},
street2 : {type: String, default : ''},
city : {type: String, default : '', required: true},
state : {type: String, required : true},
zip : {type: String, default : ''},
fieldset#account
legend Account Settings
ul
li#email
label
| Email
span.required *
input(type='text', name='account[email]')
li#password
label

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@chanced
chanced / designer.html
Last active August 29, 2015 14:16
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>
@chanced
chanced / enum.go
Last active January 10, 2021 17:17
boilerplate for extending protoc-gen-star after making methods public
package genproto
import (
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/protoc-gen-go/descriptor"
pgs "github.com/lyft/protoc-gen-star"
)
// Enum describes an enumeration type. Its parent can be either a Message or a
{
"categories": {
"form": {
"description": "Form-associated content is a subset of flow content comprising elements that have a form owner, exposed by a form attribute, and can be used everywhere flow content is expected. A form owner is either the containing <form> element or the element whose id is specified in the form attribute.",
"documentation": "https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#form-associated_content",
"elements": [
"button",
"fieldset",
"input",
"label",
@chanced
chanced / machine.js
Last active August 15, 2021 19:45
Generated by XState Viz: https://xstate.js.org/viz
const authMachine = Machine(
{
id: "auth",
initial: "initializing",
context: {
retries: 0,
user: undefined,
lastUpdated: undefined,
},
@chanced
chanced / component-types.ts
Created October 4, 2021 05:25
Couple of utility types for extracting svelte constructor options & svelte component props
export type SvelteComponentConstructorOptions<T> = T extends abstract new (
opts: Svelte2TsxComponentConstructorParameters<infer P>,
) => any
? Svelte2TsxComponentConstructorParameters<P>
: never;
export type SvelteComponentProps<T> = T extends abstract new (
opts: Svelte2TsxComponentConstructorParameters<infer P>,
) => any
? Svelte2TsxComponentConstructorParameters<P>["props"]