Skip to content

Instantly share code, notes, and snippets.

Avatar
💩

Branan Riley branan

💩
View GitHub Profile
@branan
branan / altair.js
Created Jul 21, 2021
Altair block calculation
View altair.js
const asNumber = BigInt("0xd64330b4c9eb5721260619dc4235b1bc1f342ee7c3ece88b31be96be690fb1c1")
const divisor = BigInt(1) << BigInt(256);
const result = (asNumber * (BigInt(6655171) - BigInt(6626371)) / divisor) + BigInt(6626371);
console.log(result)
View agent-bisect.sh
set -x
# USAGE
# Set the variables below for your test environment
# Run the following git commands:
# > git bisect start
# > git bisect bad <bad>
# > git bisect good <good>
# > git bisect run agent-bisect.sh
View request.patch
diff --git a/lib/puppet/indirector/request.rb b/lib/puppet/indirector/request.rb
index 3a52b0e..d969952 100644
--- a/lib/puppet/indirector/request.rb
+++ b/lib/puppet/indirector/request.rb
@@ -199,7 +199,7 @@ class Puppet::Indirector::Request
if primary_server = Puppet.settings[:server_list][0]
bound_server = primary_server[0]
else
- bound_server = nil
+ bound_server = Puppet.settings[:server]
View foo.patch
diff --git a/cmake/cflags.cmake b/cmake/cflags.cmake
index a1b1b6d..b588e91 100644
--- a/cmake/cflags.cmake
+++ b/cmake/cflags.cmake
@@ -47,10 +47,15 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
endif()
# On Windows with GCC 5.2.0, disable deprecated declarations because it causes warnings with Boost's use of auto_ptr
- if (WIN32)
+ # On Solaris 12, <insert reason here>
View symbol_comparison_benchmark.rb
require 'puppet'
require 'benchmark'
def compare_no_warn(a, b)
a.to_s <=> b.to_s
end
def compare_deprecation_warning(a, b)
if (b.class != Symbol)
View evil_type.rb
require 'uri'
module Puppet
newtype(:uri_provider) do
@doc = "A type which determines its provider based on the scheme of a URI passed as a parameter"
ensurable
newparam(:name) do
end
@branan
branan / playset.md
Last active May 18, 2016
Fiasco Template
View playset.md

preserve the spaces at the end of each line - they signal to the markdown parser that we really want line breaks there.

TITLE

Quick summary about your playset, the setting, and what's going on. No more than a couple of paragraphs - you don't want to be too prescriptive about play!

Relationships

1.

View keybase.md

Keybase proof

I hereby claim:

  • I am branan on github.
  • I am branan (https://keybase.io/branan) on keybase.
  • I have a public key whose fingerprint is 17B3 779B 9F2A 9584 71B7 4D92 EFFA AC21 382C D5CA

To claim this, I am signing this object:

View genconfig.rb
#! /usr/bin/env ruby
require 'yaml'
# Pull our version information out of the environment
PE_VERSION=ENV['pe_version']
PE_FAMILY=ENV['pe_family']
# If our version is the same as our family, we're installing a
# released version. Use the archive path. Otherwise, we want to use
View gist:8376248
LNv4P6jo2fi1UNUyWyc8NMj4SsXUpwmWXV