Skip to content

Instantly share code, notes, and snippets.

View dstroot's full-sized avatar
:octocat:
Slingin' Code

Dan Stroot dstroot

:octocat:
Slingin' Code
View GitHub Profile
@chrissimpkins
chrissimpkins / gist:5bf5686bae86b8129bee
Last active March 6, 2023 00:10
Atom Editor Cheat Sheet: macOS

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@tonyseek
tonyseek / brew-cask-upgrade
Last active November 1, 2017 02:49
Upgrade all casks
#!/usr/bin/env bash
set -e
STAGING_LOCATION="$(brew cask doctor \
| grep -A1 '==> Homebrew-cask Staging Location:' | tail -n1 \
| awk '{print $1}')"
echo "==> Upgrading casks"
for cask in $(ls ${STAGING_LOCATION})
@jamesrr39
jamesrr39 / Go Pointers.md
Last active February 19, 2019 04:05
Go Pointers

Go pointers

This gist demonstrates the use of pointers in go (and other similar languages)

Use &x to get the address of x

Use *x to get a value from an address x

When should I use a pointer?

@gaearon
gaearon / connect.js
Last active April 11, 2024 06:46
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@nathan-osman
nathan-osman / win32.go
Last active August 31, 2023 22:01
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
@JobLeonard
JobLeonard / canvas.js
Last active July 29, 2023 01:44
A react component that wraps and autosizes a canvas element
import React, {PropTypes} from 'react';
import { debounce } from 'lodash';
// A simple helper component, wrapping retina logic for canvas and
// auto-resizing the canvas to fill its parent container.
// To determine size/layout, we just use CSS on the div containing
// the Canvas component (we're using this with flexbox, for example).
// Expects a "paint" function that takes a "context" to draw on
// Whenever this component updates it will call this paint function
// to draw on the canvas. For convenience, pixel dimensions are stored
@kevinelliott
kevinelliott / 1-macOS-10.12-sierra-setup.md
Last active February 5, 2024 07:22
macOS 10.12 Sierra Setup

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@mapmeld
mapmeld / OverEncrypt.md
Last active July 25, 2023 18:55
OverEncrypt - paranoid HTTPS

OverEncrypt

This is a guide that I wrote to improve the default security of my website https://fortran.io , which has a certificate from LetsEncrypt. I'm choosing to improve HTTPS security and transparency without consideration for legacy browser support.

WARNING: if you mess up settings, lose your certificates, or decide to no longer maintain HTTPS certs, these steps can and will make your domain inaccessible.

I would recommend these steps only if you have a specific need for information security, privacy, and trust with your users, and/or maintain a separate secure.example.com domain which won't mess up your main site. If you've been thinking about hosting a site on Tor, then this might be a good option, too.

The best resources that I've found for explaining these steps are https://https.cio.gov , https://certificate-transparency.org , and https://twitter.com/konklone

@err0r500
err0r500 / main.go
Last active July 15, 2023 15:27
gin gonic with jwt from auth0 (and CORS enabled)
package main
import (
"github.com/auth0/go-jwt-middleware"
"github.com/dgrijalva/jwt-go"
"gopkg.in/gin-gonic/gin.v1"
)
func main() {
startServer()
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would