Skip to content

Instantly share code, notes, and snippets.

@jclay
jclay / chromium_vscode_settings.json
Last active December 24, 2023 04:45
chromium_vscode_settings.json
{
"clangd.path": "${workspaceFolder}/MeldStudio/third_party/llvm-build/Release+Asserts/bin/clangd",
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true,
"**/third_party": true,
"build/mac_files": true,
"MeldStudio": true,
},
int demo_modes() {
static int counter = 0;
auto increment_counter = [] {
counter++;
println("count: {}", counter);
};
// Timer ticks every 100ms and prints the latest count
auto t = RepeatingTimer(Milliseconds(100), increment_counter);
@jclay
jclay / arch_type.sh
Last active December 5, 2020 20:54
Check directory for executables that are Mac Silicon Native (ARM64)
# check Mach-O header for architecture
# where -perm +111 checks for executable file type
find /Applications -perm +111 -type f | xargs -I % zsh -c 'objdump --private-headers "%" | grep "ARM64"'
# check for X86_64 instead
find /Applications -perm +111 -type f | xargs -I % zsh -c 'objdump --private-headers "%" | grep "X86_64"'

Keybase proof

I hereby claim:

  • I am jclay on github.
  • I am jclay (https://keybase.io/jclay) on keybase.
  • I have a public key ASBw7HLXRorjx3EdwoVj67wFDMmGR-9bpXU_TZJJxq27Cgo

To claim this, I am signing this object:

@jclay
jclay / pretty_print_table.md
Last active February 13, 2019 02:00
Pretty print table from stdout

Pretty printing a table from stdout

On a recent project, I was outputting some tab separated data to stdout for debugging. It looked something like this:

Type	Result	Time (ms)	
----	----	----	
Traditional	54986	0.001842	
Range	54986	0.000325	
For Each	54986	0.000282	
@jclay
jclay / rpm_source_build.md
Created February 8, 2019 19:24
RPM Build From Source

Modify and rebuild a source RPM on Fedora

In several cases, there has been an RPM in the Fedora repo's which I would like to use, but is out of date.

I'm using the following in order to pull the source rpm, bump the version and reinstall.

I'm using the cloc tool here as an example. You may find it helpfult reference this guide from Fedora

Setup

@jclay
jclay / m705_logitech_linux.md
Created February 8, 2019 01:20
Fixing Logitech M705 Mouse in Linux

Fixing Logitech M705 Mouse in Linux

I have experienced issues with the free scroll toggle button on older Logitech M705 mouse in every distribution I've tried.

Here's how I ended up fixing it:

$> xinput list

⎡ Virtual core pointer                          id=2    [master pointer  (3)]
@jclay
jclay / .spacemacs-snippet.el
Created December 28, 2017 21:35
Spacemacs - Prevent :q from killing emacs
;; This goes in dotspacemacs/user-config () function
;; :q kills only the current buffer
(evil-ex-define-cmd "q" 'kill-this-buffer)
;; Use :quit to close emacs
(evil-ex-define-cmd "quit" 'evil-quit)
@jclay
jclay / Gemfile
Last active September 1, 2015 22:52
checkr - stack level too deep
source "https://rubygems.org"
gem 'activesupport', '4.2.3'
gem 'checkr-official', '1.0.2'
@jclay
jclay / gist:be206448fce31651407f
Created July 27, 2015 16:59
Using active_job test helpers with RSpec
require 'active_job'
RSpec.configure do |config|
config.include ActiveJob::TestHelper
end