Skip to content

Instantly share code, notes, and snippets.

View leobalter's full-sized avatar
💭
status

Leo Balter leobalter

💭
status
View GitHub Profile
@leobalter
leobalter / 1-setup.md
Created April 25, 2022 23:35 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

op_list = [
("<", lambda a, b: a < b, "less-than"),
("<=", lambda a, b: a <= b, "less-than-or-equal"),
(">", lambda a, b: a > b, "greater-than"),
(">=", lambda a, b: a >= b, "greater-than-or-equal"),
]
# This is the hex representation of Number.MAX_VALUE.
max_value_digits = "0xfffffffffffff8" + "0" * 242
onst getLast = (arr, def) => (arr[arr.length - 1] || def)
const getLastUser = arr => {
const last = getLast(arr, [])
return getLast(last, {})
}
const pushIntoLast = (arr, value) => {
const last = getLast(arr, [])
last.push(value)
@leobalter
leobalter / .profile
Created March 26, 2017 06:48 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
First you need to build JSC. Since it is a module in WebKit, you can follow these instructions to get the code and learn how to build it.
https://webkit.org/getting-started/#building-webkit
After the machine setup, you can build JSC as a stand-alone CLI program running
```<path_to_webkit>/Tools/Scripts/build-jsc —release```
It will build jsc into ```<path_to_webkit>/WebKitBuild/Release```
@leobalter
leobalter / git-gpg.md
Created June 16, 2016 16:33 — forked from bcomnes/git-gpg.md
my version of gpg on the mac
  1. brew install gnupg21, pinentry-mac (this includes gpg-agent and pinentry)

  2. Generate a key: $ gpg --gen-key

  3. Take the defaults. Whatevs

  4. Tell gpg-agent to use pinentry-mac:

    $ vim ~/.gnupg/gpg-agent.conf 
    
@leobalter
leobalter / post-merge
Created March 15, 2016 18:44 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@leobalter
leobalter / karma.conf.js
Created November 12, 2015 23:01 — forked from frederickfogerty/karma.conf.js
Coverage + tests with webpack, babel, karma, mocha, and istanbul
var webpack = require('webpack')
module.exports = function (config) {
config.set({
browsers: [ 'Chrome' ], //run in Chrome
browserNoActivityTimeout: 60000,
singleRun: true, //just run once by default
frameworks: [ 'mocha' ], //use the mocha test framework
files: [
//'src/**/*.{jsx,js}',
@leobalter
leobalter / _css_dropdown_menu.markdown
Last active August 29, 2015 14:21 — forked from anonymous/index.html
CSS Dropdown Menu

CSS Dropdown Menu

('-' * 6)

A Pen by Leo Balter on CodePen.

License

Copyright (c) 2015 by Leonardo Balter

The idea is to have nginx installed and node installed. I will extend this gist to include how to install those as well, but at the moment, the following assumes you have nginx 0.7.62 and node 0.2.3 installed on a Linux distro (I used Ubuntu).

In a nutshell,

  1. nginx is used to serve static files (css, js, images, etc.)
  2. node serves all the "dynamic" stuff.

So for example, www.foo.com request comes and your css, js, and images get served thru nginx while everything else (the request for say index.html or "/") gets served through node.

  1. nginx listens on port 80.