This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open https://youtu.be/rfMC2aVhYuo?t=39s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// given a form element | |
// get its children that have a name attribute | |
// map to { name, value } objects | |
// reduce individual into one { [name]: value } object | |
export default formElement => Array.from(formElement.querySelectorAll('[name]')) | |
.map(({ name, value }) => ({ name, value })) | |
.reduce((current, item) => ({ ...current, [item.name]: item.value }), {}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mcpi import minecraft | |
from mcpi import block | |
from minecraftstuff import MinecraftTurtle | |
from random import randint | |
import time | |
import os.path, sys | |
mc = minecraft.Minecraft.create(address="158.69.221.37", name="steve") | |
block_air = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AWS from 'aws-sdk/global'; | |
import S3 from 'aws-sdk/clients/s3'; | |
import { | |
AuthenticationDetails, | |
CognitoUser, | |
CognitoUserPool, | |
} from 'amazon-cognito-identity-js'; | |
const REGION = 'some-string-value'; | |
const USER_POOL_ID = 'some-string-value'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Let's say you have a list of items, and something to do with each item. You want to be able to tell the system when to do the thing on an item, and to be able to select what item to do the thing on. For convenience sake, you want to be able to choose the next item or the previous item, or any item in the list (by index of course). | |
The difference between this and a reducer, for example, is that this system provides an interface for outside interaction. | |
Right now the class assumes that the list of items are dom elements, children of some parent element, and the task to be applied is toggling a css class. This is already useful for a wide variety of applications, including carousels, image sliders and slide shows. But essentially it only works on the front end. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
BUILD_DIR=build | |
git checkout -b _build_staging_ | |
git add -f $BUILD_DIR | |
git commit -am add_build_ouput | |
git subtree split --prefix $BUILD_DIR -b gh-pages | |
git push origin gh-pages -f | |
git checkout - |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to ~/.profile or ~/.bashrc or whatever | |
# ask for a confirmation before executing the following command | |
confirm() { | |
read -r -p "Are you sure? [y/N] " response | |
[[ $response =~ ^([yY][eE][sS]|[yY])$ ]] && $@ | |
} | |
export alias c=confirm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
promptFunc() { | |
COOL_COLOR="\[\e[38;5;25m\]" | |
REPO_FORMAT="\[\e[48;5;233m\]" | |
DIM="\[\e[2m\]" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.