Skip to content

Instantly share code, notes, and snippets.

View colinta's full-sized avatar
🏠
Working from home

Colin T.A. Gray colinta

🏠
Working from home
View GitHub Profile
#include <Mechy.h>
#include <Mechy/Scanner.h>
#include <Mechy/KeyPress.h>
#include <Mechy/MediaKey.h>
#include <Mechy/Sticky.h>
#include <Mechy/Lock.h>
#include <Mechy/Macro.h>
#define ROWS 5
#define COLS 4
@colinta
colinta / cape.py
Last active January 12, 2018 17:47
Cape ported to python
CHAR_MASK = ((1 << 8) - 1)
# Compute a 1 byte version of the encryption key
def cape_compute_reduced_key(key, length):
reduced_key = 0
# Reduced key computation
for i in xrange(0, length):
reduced_key = (reduced_key ^ (key[i] << (i % 8))) & CHAR_MASK
return reduced_key
make test:all
QMK Firmware 0.5.192
WARNING:
Some git sub-modules are out of date or modified, please consider runnning:
make git-submodule
You can ignore this warning if you are not compiling any ChibiOS keyboards,
or if you have modified the ChibiOS libraries yourself.
Making test basic [ERRORS]
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/c++/4.2.1
require './generate_release_notes'
fastlane_version "1.111.0"
generated_fastfile_id "9dadcd46-3eaf-4291-8129-b3f6f4f4e1ff"
default_platform :ios
before_all do
extract_from_env(
defaults: {
@colinta
colinta / Package.swift
Created February 22, 2017 21:56
Trying to link ncurses using SPM
let package = Package(
name: "Cncurses",
pkgConfig: "ncurses"
)
@colinta
colinta / git by colin.md
Last active February 8, 2017 21:23
My quick and dirty dive into git theory and tricks

GIT OBJECTS

.git/objects /f4/8011a40ba2f5b9f6af3b387e

  • This is the "heart" of git, but not the brains

  • key-value store (key == sha1!)

  • blobs

  • trees

#!/usr/bin/env ruby
filename = ARGV[0] or exit(0)
i = 1
arg = ARGV[i]
whitelist = []
while arg && arg != '--' do
whitelist << arg
i += 1
arg = ARGV[i]
set show-all-if-ambiguous on
set expand-tilde off
set visible-stats off
set blink-matching-paren on
set mark-symlinked-directories on
set skip-completed-text on
# default is backward-kill-shell-word I think
"\C-w": backward-kill-word
diff --git a/src/components/posts/PostTools.js b/src/components/posts/PostTools.js
index b69f64f..a9b04cb 100644
--- a/src/components/posts/PostTools.js
+++ b/src/components/posts/PostTools.js
@@ -172,9 +172,13 @@ class PostTools extends Component {
};
toggleComments = () => {
- const { dispatch, post } = this.props
+ const { author, dispatch, isLoggedIn, post } = this.props
diff --git a/src/reducers/json.js b/src/reducers/json.js
index 9ece66d..a89dff1 100644
--- a/src/reducers/json.js
+++ b/src/reducers/json.js
@@ -418,13 +418,12 @@ export default function json(state = {}, action = { type: '' }) {
keepers[collection] = action.payload.json[collection]
}
}
- return { ...state, ...keepers }
+ newState = { ...newState, ...keepers }