Skip to content

Instantly share code, notes, and snippets.

View juzten's full-sized avatar
💭
(┛ಠ_ಠ)┛彡┻━┻

Justin Spain juzten

💭
(┛ಠ_ಠ)┛彡┻━┻
View GitHub Profile
@juzten
juzten / blog3.md
Created July 27, 2022 21:04 — forked from khushal87/blog3.md
Linking a custom domain from Google domains to Vercel app

Linking a custom domain to a deployed application is confusing and at times you don't get a route on how to link the domain with the website. 😫

In this article, I will be explaining how to link a Custom domain brought in Google Domains service to an application hosted on Vercel.

Perks of using vercel is that it allows adding domain without any verification unlike Heroku/Netlify, which means you don't have to add your billing details to add a domain to your application. Moreover, it is fast, efficient, and easy to use.😁

What is Vercel?

​Vercel is a deployment and collaboration platform for frontend developers. ​Vercel enables developers to host websites and web services that deploy instantly and scale automatically – all without any configuration. Source - Official Docs

@juzten
juzten / dynamicFormWTF.md
Created June 15, 2021 06:26 — forked from overdese/dynamicFormWTF.md
WTF SelectField with dynamic choice

class wtforms.fields.SelectField(default field arguments, choices=[], coerce=unicode, option_widget=None)
Select fields keep a choices property which is a sequence of (value, label) pairs. The value portion can be any type in theory, but as form data is sent by the browser as strings, you will need to provide a function which can coerce the string representation back to a comparable object.

Select fields with static choice values:

class PastebinEntry(Form):
    language = SelectField(u'Programming Language', choices=[('cpp', 'C++'), ('py', 'Python'), ('text', 'Plain Text')])
    
@juzten
juzten / gist:6505c251ea7fdd417d638adad9f43d88
Created April 10, 2020 01:16 — forked from ozh/git cherry-pick within a pull request.md
git cherry-pick within a pull request

1. Create new branch:

git checkout -b otherrepo-master master

2. Get the contents of the PR

git pull https://github.com/otherrepo/my-repo-name.git master
@juzten
juzten / gist:2ccc68cf185722d131500bd50ac7582d
Created October 10, 2018 23:33 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@juzten
juzten / python_switch.py
Created September 25, 2018 13:52
Python Switch statement
def print_greeting(venue, name):
"""Print greeting for a specific venue."""
venues = {
'walmart': walmart_greeting,
'target': target_greeting,
'aldi': aldi_greeting,
'food lion': food_lion_greeting,
}
@juzten
juzten / git-ui.md
Last active August 21, 2018 02:16
Git lightweight web UI

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@juzten
juzten / code style.md
Created May 23, 2018 12:49 — forked from igogrek/Vue code style.md
Code style and application structure

Application structure

General

  1. Application has tree structure with folders for each "feature"
  2. Feature folders are named with lowerCamelCase → myComponentDashboard
  3. Feature can contain any number of components and nested features
  4. Components are named using UpperCamelCase → MyWidgetComponent.vue
  5. Component can have translation .yml file named correspondingly → MyWidgetComponent.yml
  6. If component requires more than 2 files: .vue and .yml file - folder is created with the same name → MyWidgetComponent
@juzten
juzten / excel_things.py
Created December 7, 2017 20:23 — forked from urschrei/excel_things.py
Open CSV or Excel files, return the contents as a list of lists, write out to Excel file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
excel_things.py
Created by Stephan Hügel on 2011-05-07
Read XLS or CSV files, and return contents as unicode strings in nested lists
One row per list item, one column per nested list item:
[[u'foo', u'bar'], [u'baz', u'abc123'], … ]
@juzten
juzten / postgres-import-export-csv.md
Created December 6, 2017 05:16 — forked from nepsilon/postgres-import-export-csv.md
Importing and Exporting CSV files with PostgreSQL — First published in fullweb.io issue #19

Importing and exporting CSV files with PostgreSQL

Let’s see how to use PostgreSQL to import and export CSV files painlessly with the COPY command.

Import CSV into table t_words:

COPY t_words FROM '/path/to/file.csv' DELIMITER ',' CSV;

You can tell quote char with QUOTE and change delimiter with DELIMITER.