Skip to content

Instantly share code, notes, and snippets.

💭
Living the dream

Zack Kollar SeedyROM

💭
Living the dream
Block or report user

Report or block SeedyROM

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@SeedyROM
SeedyROM / ExampleContext.tsx
Created Jun 18, 2019
A simple TypeScript based React Context and Hooks state management tool.
View ExampleContext.tsx
import isEqual from "lodash/isEqual";
// Types for testing
import { ICartItem } from "../types/Cart";
import createStore from '../helpers/createStore';
type State = ICartItem[];
type Action =
| { type: "add" | "remove", item: ICartItem }
| { type: "clear" };
@SeedyROM
SeedyROM / query-params.js
Last active May 13, 2019
Functional helper to build query parameters for GET requests.
View query-params.js
const buildQueryParams = (params) => (
Object
.keys(params)
.reduce((q, k) => q + `${k}=${params[k]}&`, '?')
.slice(0, -1)
);
// Usage:
const queryParams = buildQueryParams({
hello: 'world',
@SeedyROM
SeedyROM / styled-wrapper.tsx
Last active Jan 11, 2019
A simple helper to create functional Vue components with CSS modules and Typescript.
View styled-wrapper.tsx
import { componentFactory } from 'vue-tsx-support';
import { VNode } from 'vue';
type Styles = string | Array<string>;
interface WrapperProps {
as?: string;
}
export default (
@SeedyROM
SeedyROM / map-globals.scss
Last active Dec 28, 2018
SCSS & CSS variable global mixin.
View map-globals.scss
// ----
// libsass (v3.5.4)
// ----
@function is-map($value) {
@return type-of($value) == 'map';
}
@mixin _globals($map, $prefix: '') {
@each $key,
@SeedyROM
SeedyROM / settings.json
Last active Nov 27, 2018
My VSCode settings for Vue development!
View settings.json
{
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"eslint.autoFixOnSave": true,
"eslint.validate": [{
"language": "vue",
"autoFix": true
},
{
@SeedyROM
SeedyROM / Django Project Setup.md
Last active May 13, 2019
Django Project: How To? (venv)
View Django Project Setup.md

How to start a Django project  (PDXCG Style)

Open a terminal and go to wherever you want to create your project!

Make sure to replace $PROJECT_NAME with your own project name. Your project name should be named in snake_case and contain no captial letters.

The Steps

  1. Create a directory
    • mkdir $PROJECT_NAME
@SeedyROM
SeedyROM / index.md
Created Mar 7, 2018
Django startproject guide.
View index.md

How to start a Django project  (PDXCG Style)

Open a terminal and go to wherever you want to create your project!

Make sure to replace $PROJECT_NAME with your own project name. Your project name should be named in snake_case and contain no captial letters.

The Steps

  1. Create a directory
    • mkdir $PROJECT_NAME
@SeedyROM
SeedyROM / update-vscode.sh
Created Feb 9, 2018
A quick shell script to update VSCode on Linux.
View update-vscode.sh
# Update VS Code.
function update-vscode() {
wget https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable -O /tmp/code_latest_amd64.deb
sudo dpkg -i /tmp/code_latest_amd64.deb
}
update-vscode
@SeedyROM
SeedyROM / resetmigrations.py
Last active Sep 24, 2017
Django: Reset Applcation Migrations Command
View resetmigrations.py
import glob
import os
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
"""A command to remove all migrations from django apps.
View setup_env.sh
#!/usr/bin/env bash
#
# A simple script to setup the development env.
#
ENV_NAME="env"
DEPS_FILE="requirements.txt"
if [[ $# -eq 1 ]]; then
You can’t perform that action at this time.