Skip to content

Instantly share code, notes, and snippets.

@hubgit
hubgit / SelectField.tsx
Last active December 29, 2023 03:41
Use react-select with Formik
import { FieldProps } from 'formik'
import React from 'react'
import Select, { Option, ReactSelectProps } from 'react-select'
export const SelectField: React.SFC<ReactSelectProps & FieldProps> = ({
options,
field,
form,
}) => (
<Select
@chancesmith
chancesmith / readme.md
Last active November 24, 2021 11:47
Wordpress Setup shell script

Setup Instructions

  • add wp-setup.sh to your home directory
  • in terminal $ chmod +x wp-setup.sh so we can execute this without admin permissions needed
  • add an alias in your terminal profile and source the profile...(see command in next step)
  • $ echo '\n\n alias wpsetup="~/wp-setup.sh"' >> ~/.zshrc && . ~/.zshrc

Usage

Now, when you are ready run $ wpsetup in the folder you want to setup Wordpress locally in.

@shoman4eg
shoman4eg / output.css
Last active July 9, 2018 16:22
Less space utilities
.mt-5 {
margin-top: 5px;
}
.mr-5 {
margin-right: 5px;
}
.mb-5 {
margin-bottom: 5px;
}
.ml-5 {
@learncodeacademy
learncodeacademy / webpack.config.js
Created January 8, 2016 03:55
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
<?php
// Version CSS file in a theme
wp_enqueue_style(
'theme-styles',
get_stylesheet_directory_uri() . '/style.css',
array(),
filemtime( get_stylesheet_directory() . '/style.css' )
);
@stevebowman
stevebowman / AWSLambdaSimpleSMS.js
Last active June 22, 2023 12:09
AWS Lambda Function to send an SMS message via the Twilio API
console.log('Loading event');
// Twilio Credentials
var accountSid = '';
var authToken = '';
var fromNumber = '';
var https = require('https');
var queryString = require('querystring');
@koistya
koistya / React-Directory-Layout.md
Last active April 7, 2024 19:01
File and folder naming convention for React.js components

File and folder naming convention for React.js components

Directory Layout #1

/actions/...
/components/common/Link.js
/components/common/...
/components/forms/TextBox.js
/components/forms/TextBox.res/style.css
<div>
<label for="sort-by">Sort by</label>
<select id="sort-by">
<option value="manual">Featured</option>
<option value="price-ascending">Price: Low to High</option>
<option value="price-descending">Price: High to Low</option>
<option value="title-ascending">A-Z</option>
<option value="title-descending">Z-A</option>
<option value="created-ascending">Oldest to Newest</option>
<option value="created-descending">Newest to Oldest</option>
@waltz
waltz / .zshrc
Created January 27, 2014 22:22
ZSH, iTerm2 Alt-Arrow (Left/Right) Key remap
# Remap alt-left and alt-right to forward/backward word skips.
# via @waltz, https://gist.github.com/waltz/8658549
bindkey "^[^[[D" backward-word
bindkey "^[^[[C" forward-word
@joyrexus
joyrexus / README.md
Last active February 19, 2024 17:15 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})