Skip to content

Instantly share code, notes, and snippets.

View JonathanTron's full-sized avatar

Jonathan Tron JonathanTron

View GitHub Profile

Prerequisites

You'll need to have a system running that is accessible through a DNS record. It should have access to the public Habitat depot, https://app.habitat.sh so it can download the required packages.

You'll need to register an OAuth application for GitHub. You need the client ID and client secret that are created for the application later in this guide. Your system needs to have access to https://github.com so that it can authenticate.

Your system also needs to have an FQDN that can be resolved, for example depot.example.com. This will be used in your OAuth application's "Authorization Callback URL." For this example, use http://depot.example.com/#/sign-in. The /#/sign-in is required.

Operating System

@fdv
fdv / es-cheat-sheet.md
Last active February 2, 2021 14:44
An ElasticSearch management cheat sheet

These are the snippets I use most of the time when administrating my ES cluster

To be updated

Settings to change before you do something

Before restarting a data node

curl -XPUT 'http://escluster:9200/_cluster/settings' -d '{
@paulirish
paulirish / what-forces-layout.md
Last active November 15, 2024 16:45
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@limhoff-r7
limhoff-r7 / authenticate.ex
Created June 3, 2015 19:09
Authenticate user using session or params (uses session keys stuff from Authlogic in Rails). **NOTE: this is does no authorization, another plug needs to be written to require conn.assigns[:authorized_user] is set or that they have permissions to read records**
defmodule Metasploit.Pro.Plugs.Authenticate do
import Ecto.Query, only: [from: 2]
import Plug.Conn
def init(configuration) do
configuration
|> Keyword.put_new(:single_access_token_parm, "single_access_token")
|> valid_configuration!
end
@dblandin
dblandin / Rakefile
Last active June 17, 2016 15:30 — forked from ParkinT/Rakefile
RubyMotion Configuration and Deploy/Release
# -*- coding: utf-8 -*-
$:.unshift('/Library/RubyMotion/lib')
require 'motion/project/template/ios'
require 'bundler'
Dir.glob('./config/*.rb').each { |file| require file }
if ARGV.join(' ') =~ /spec/
Bundler.require :default, :development, :spec
elsif ARGV.join(' ') =~ /testflight/
@xaviershay
xaviershay / ruby_live_gc_stats.rb
Created November 10, 2013 21:17
naive jstat proof-of-concept for ruby
Thread.new do
GC::Profiler.enable
current_message = ""
epoch = Time.now
total_time = 0
gc_events = 0
heap_use = 0
heap_size = 0
fmt = "%7s %5s %15s %15s %10s"
@adamhjk
adamhjk / Guardfile
Last active December 17, 2015 03:19
A Guardfile with inline support for test-kitchen, before we turn it into a gem.
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
require 'guard/guard'
require 'mixlib/shellout'
module ::Guard
class Kitchen < ::Guard::Guard
def start
::Guard::UI.info("Guard::Kitchen is starting")
@manpages
manpages / elixir-newbie-digest-002.md
Last active December 11, 2015 22:39
Elixir Newbie Digest, Issue 2

Intro

Today I'll cover three basic topics:

  • Mistakes and misuses every Erlanger does when he starts to write in Elixir

  • Dependencies and Mix

  • Writing OTP-enabled Elixir applications

@cengage
cengage / OS X build plan for veewee
Last active October 28, 2020 14:01
First shot at describing the process of building a vanilla OS X box with veewee using only the OS X installer application.
Notes using minstallconfig.xml
- Create base OS X vmx w/ veewee:
* HD must be IDE, not SCSI
* Do not define a specific boot device, VM will boot from DMG attached to CD-ROM later in process
- Obtain "Install OS X Mountain Lion.app"/"Install Mac OS X Lion.app"
- Mount InstallESD.dmg w/ shadow file from "Install Mac OS X Lion.app/Contents/SharedSupport/InstallESD.dmg"
* hdiutil attach "[...]/Install Mac OS X Lion.app/Contents/SharedSupport/InstallESD.dmg" -owners on -shadow /tmp/InstallESD.shadow