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
| ########################################################################### | |
| # REACT SNIPPETS # | |
| ########################################################################### | |
| snippet ccom "Class React Component" bA | |
| class $1 extends Component { | |
| render() { | |
| return ( | |
| <$2> | |
| $0 | |
| </$2> |
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 setuptools import setup | |
| with open('README.md') as f: | |
| long_description = f.read() | |
| setup( | |
| name='package name', | |
| version='0.0', | |
| license='MIT', | |
| description='Short description', |
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 os | |
| import sys | |
| import requests | |
| from pprint import pprint | |
| EVENTS_URL = "https://api.github.com/users/{username}/events" | |
| class Github(): | |
| def __init__(self, token): | |
| self.token = token |
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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "os" |
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
| package main | |
| // Adapter takes in a http.Handler, enhances it, | |
| // and returns another http.Handler | |
| type Adapter func(http.Handler) http.Handler | |
| // Composes variadic adapters and returns a final | |
| // adapter to be applied to the http.Handler | |
| func Compose(adapters ...Adapter) Adapter { | |
| return func(h http.Handler) http.Handler { |
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
| package util | |
| import "strings" | |
| // Interpolate replaces the values in the input string | |
| // inside parentheses with the params supplied. | |
| // Example: | |
| // Interpolate("/{owner}/{repo}", map[string]string{"owner: "golang", "repo": "go"}) | |
| // Returns: | |
| // "/golang/go" |
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
| # References: | |
| # https://github.com/tmux/tmux/issues/543 | |
| # https://github.com/tmux/tmux/issues/543#issuecomment-298193820 | |
| # | |
| # PREREQUISITE: | |
| # ❯ brew install reattach-to-user-namespace --wrap-pbcopy-and-pbpaste | |
| # Add the following snippet to your .tmux.conf - | |
| setw -g mode-keys vi | |
| set -g default-shell $SHELL |
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
| if (has('nvim')) | |
| " Path to Python2 and Python3 binaries which are required by some plugins. | |
| " A function that runs the shell `which` command and sanitizes the output. | |
| function! Which(cmd) | |
| return substitute(system("which " . a:cmd), "\n", "", "") | |
| endfunction | |
| let g:python_host_prog = Which("python2") | |
| let g:python3_host_prog = Which("python3") |
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
| on escape_quotes(string_to_escape) | |
| set AppleScript's text item delimiters to the "\"" | |
| set the item_list to every text item of string_to_escape | |
| set AppleScript's text item delimiters to the "\\\"" | |
| set string_to_escape to the item_list as string | |
| set AppleScript's text item delimiters to "" | |
| return string_to_escape | |
| end escape_quotes | |
| tell application "Spotify" |
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
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "io/ioutil" | |
| "os" | |
| "strconv" | |
| "strings" | |
| "sync" |
OlderNewer