Skip to content

Instantly share code, notes, and snippets.

View Narven's full-sized avatar
👾
Walking to the fridge...

P Ξ D R O L U Z Narven

👾
Walking to the fridge...
View GitHub Profile
@iamtmrobinson
iamtmrobinson / custom-props.tsx
Created January 8, 2018 14:49
Using custom props with a Redux form in Typescript
import * as React from 'react';
import {
Field as FormField,
InjectedFormProps,
reduxForm,
} from 'redux-form';
interface CustomProps {
customText: string;
}
@nicoplv
nicoplv / 0-UnityScriptTemplates.info
Last active April 29, 2024 12:56
List of C# Script Templates for Unity 3D
List of C# Script Templates for Unity 3D:
81-C#__Behavior-NewBehaviour.cs.txt
81-C#__BehaviorListed-NewBehaviourListed.cs.txt
81-C#__Class-NewClass.cs.txt
81-C#__Interface-NewInterface.cs.txt
81-C#__ScriptableObject-NewScriptableObject.cs.txt
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=mybinary
BINARY_UNIX=$(BINARY_NAME)_unix
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@mkhairi
mkhairi / gitcheats.txt
Created June 13, 2017 05:10 — forked from chrismccoy/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# push changes to an empty git repository for the first time
git push --set-upstream origin master
# Remove + and - from start of diff lines
git diff --color | sed "s/^\([^-+ ]*\)[-+ ]/\\1/" | less -r
# clear out git hooks
@mbenatti
mbenatti / 0-font-awesome-bootstap-phoenix.md
Last active February 2, 2024 14:59
Installing Bootstrap 4 + Font Awesome from NPM in Phoenix Framework using sass
  • Tested with Phoenix 1.3

1) Installing sass, font-awesome and bootstrap package's using Brunch

First, install the Sass, Font Awesome, bootstrap(and deps) package:

cd assets

  • npm install --save-dev sass-brunch
  • npm install --save font-awesome
@mdonkers
mdonkers / server.py
Last active April 30, 2024 23:26
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}

The Complete Guide to Nested Forms in Phoenix

I recently spent some time dealing with nested forms in Phoenix. Nested forms are great when you want to create multiple database records in a single transaction and associate them with each other. I am new to Phoenix and really struggled to find any resources that helped me with my specific problem. I decided to document what I learned in the process in hopes of helping others that are new to Elixir and Phoenix.

Here is my attempt at a one stop shop to learn everything you will need to know about nested forms. If you would like to view the GitHub repo you can check it out here.

Thanks to Heartbeat and Jose for excellent blog posts on nested forms. Also shoutout to Josh for showing me some examples at Ruby

@jlauemoeller
jlauemoeller / phoenix-and-vue-with-brunch.md
Last active July 14, 2020 21:25
Setting up a Basic Phoenix+Vue+Brunch project

Work in Progress: Phoenix + Vue + Brunch

This documents how I integrate Vue 2.0 with Phoenix 1.x using the default brunch pipeline.

The toolchain

Start out by adding the vue-brunch plugin. You will need a version later than 1.2.3 in order to be able to use the extractCSS option (see later). At the time of writing, 1.2.3 was still the version fetched by npm so I suggest just getting the tip of the dev branch for now (this branch is for Vue 2.0 compatibility anyway):

npm install git+https://github.com/nblackburn/vue-brunch.git#dev --save-dev