Skip to content

Instantly share code, notes, and snippets.

View justincampbell's full-sized avatar
🌯
🍩

Justin Campbell justincampbell

🌯
🍩
View GitHub Profile
@JonathonRichardson
JonathonRichardson / HTMLComment.tsx
Created December 12, 2020 17:30
React Component for HTML Comment
import * as React from 'react';
import * as ReactDOM from 'react-dom';
interface IProps {
text: string;
}
export class HTMLComment extends React.Component<IProps> {
private node: Comment;
private ref$rootDiv = React.createRef<HTMLDivElement>();
@Dids
Dids / Compile_Go_for_Apple_Silicon_M1.md
Last active September 25, 2023 01:55
Compile Go for Apple Silicon (M1)

NOTICE: This guide is no longer relevant, as a lot has changed over time and Go supports Apple Silicon natively just fine now!

Compile Go for Apple Silicon (M1)

Follow these short instructions on how to compile Go for Apple Silicon (M1). From here on out, we may simply refer to it as the "ARM device".

This entire process should only take about 5-10 minutes, but please read through everything carefully, in order to avoid any potential issues along the way.

Note that at the time of writing this, Go was not yet officially available for Apple's ARM.

@alisdair
alisdair / intensify.sh
Created May 21, 2019 23:44
intensifies Slack emoji creator
#!/bin/bash
# Generate a `:something-intensifies:` Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
# Number of frames of shaking
count=10
# Max pixels to move while shaking
@paultyng
paultyng / password.tf
Last active November 30, 2017 22:52
Terraform Random Password Module
variable "length" {
default = "20"
}
resource "random_id" "password" {
byte_length = "${var.length * 3 / 4}"
}
output "password" {
value = "${random_id.password.b64}"
@AndrewRadev
AndrewRadev / ember-projections.json
Last active May 6, 2021 17:47
A `.projections.json` file that can be used with vim-projectionist for navigating ember.js projects
{
"app/initializers/*.js": {
"type": "initializer"
},
"app/models/*.js": {
"type": "model",
"alternate": "app/adapters/{}.js",
},
"app/adapters/*.js": {
"type": "adapter",
@themoxman
themoxman / colorscheme_changer.vim
Last active August 29, 2015 14:13
Press F8 or `:NC` (next color) to change and show current colorscheme.
" colors from https://github.com/flazz/vim-colorschemes
let s:mycolors = ['256-jungle', '3dglasses', 'BlackSea', 'C64', 'Chasing_Logic', 'ChocolateLiquor', 'ChocolatePapaya', 'CodeFactoryv3', 'DevC++', 'Monokai-chris', 'Monokai', 'MountainDew', 'PapayaWhip', 'SlateDark', 'Tomorrow-Night-Blue', 'Tomorrow-Night-Bright', 'Tomorrow-Night-Eighties', 'Tomorrow-Night', 'Tomorrow', 'abra', 'adam', 'adaryn', 'adobe', 'adrian', 'advantage', 'af', 'aiseered', 'anotherdark', 'ansi_blows', 'apprentice', 'aqua', 'ashen', 'asmanian_blood', 'astronaut', 'asu1dark', 'atom', 'automation', 'autumn', 'autumnleaf', 'babymate256', 'badwolf', 'base16-atelierdune', 'basic', 'bayQua', 'baycomb', 'bclear', 'beachcomber', 'beauty256', 'bensday', 'billw', 'biogoo', 'black_angus', 'blackbeauty', 'blackboard', 'blackdust', 'blacklight', 'blazer', 'blink', 'blue', 'bluechia', 'bluedrake', 'bluegreen', 'blueprint', 'blueshift', 'bluez', 'blugrine', 'bmichaelsen', 'bocau', 'bog', 'borland', 'breeze', 'brookstream', 'brown', 'bubblegum', 'bur
@dmcclory
dmcclory / ruby_hoist.rb
Created July 3, 2014 21:01
Ruby Hoists Variables!
class Foo
def awesome(x)
y = 50
x + y
end
end
set_trace_func proc { |event, file, line, id, binding, classname|
# output the binding at the start of any call to Foo#awesome
@dmcclory
dmcclory / bacon.html
Created April 16, 2014 01:01
Bacon.js example
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.10/bacon.js"></script>
</head>
<body>
<div>Running total: <span id="amount"></span></div>
<div id="ledger">
<input type="text" id="entry">
<button>Awesome!</button>
@chantastic
chantastic / .projections.json
Last active February 13, 2024 19:42
ember-cli VIM projections
{
"app/adapters/*.js": {
"command": "adapter",
"template": [
"// export default DS.{capitalize}Adapter.extend();",
]
},
"app/components/*.js": {
"command": "component",
@thbar
thbar / go_build.rb
Last active March 4, 2017 02:09
Integration testing of a golang app with rspec and capybara-webkit.
module GoBuild
extend self
def build(file)
process = ChildProcess.build('go', 'build', file)
err = Tempfile.new('stderr-spec')
process.io.stderr = err
process.start
process.poll_for_exit(10)
err.rewind