Skip to content

Instantly share code, notes, and snippets.

@calid
calid / aws_sso_config
Last active December 4, 2023 17:02
aws sso profile configuration that works with cdk
# ~/.aws/config
# NOTE: I will still occasionally get an 'Unable to resolve AWS account to use'
# cdk error when my sso token expires. CDK does not currently seem to trigger
# an sso refresh, nor does it provide a meaningful error message. However this
# is easily fixed by running `aws sso login` manually to refresh the token
# See: https://github.com/aws/aws-cdk/issues/24744
[sso-session my_session]
sso_start_url = https://d-xxxxxxxxxx.awsapps.com/start
@calid
calid / linux-keybindings.json
Created February 1, 2020 13:39
vscode default bindings
// Override key bindings by placing them into your key bindings file.
[
{ "key": "escape escape", "command": "workbench.action.exitZenMode",
"when": "inZenMode" },
{ "key": "shift+escape", "command": "closeReferenceSearchEditor",
"when": "inReferenceSearchEditor && !config.editor.stablePeek" },
{ "key": "escape", "command": "closeReferenceSearchEditor",
"when": "inReferenceSearchEditor && !config.editor.stablePeek" },
{ "key": "shift+escape", "command": "cancelSelection",
"when": "editorHasSelection && textInputFocus" },
@calid
calid / groovy_completion.shellcheck.out
Last active March 13, 2019 14:09
apache/groovy shellcheck warnings
In grape_completion line 65:
function ArrContains() {
^-- SC1009: The mentioned parser error was in this function.
^-- SC1073: Couldn't parse this brace group.
In grape_completion line 68:
eval lArr1=("\"\${$1[@]}\"")
^-- SC1056: Expected a '}'. If you have one, try a ; or \n in front of it.
@calid
calid / squash-demo.txt
Last active March 16, 2016 19:58
rebase -i example
desktop ~/tmp/gitplay
[✓]▶ git init
Initialized empty Git repository in /Users/dylan.cali/tmp/gitplay/.git/
desktop (master #) ~/tmp/gitplay
[✓]▶ echo ohhai > foo
desktop (master #?) ~/tmp/gitplay
[✓]▶ git add foo
@calid
calid / make.out
Created January 9, 2016 19:50
tcc build log
dcali-fedora (mob[release_0_9_26-611]=) ~/git/tinycc
[✔]▶ ./configure
Binary directory /usr/local/bin
TinyCC directory /usr/local/lib/tcc
Library directory /usr/local/lib64
Include directory /usr/local/include
Manual directory /usr/local/share/man
Info directory /usr/local/share/info
Doc directory /usr/local/share/doc//usr/local/lib/tcc
Target root prefix
@calid
calid / import index for gradle core
Created December 13, 2015 18:28
vim-java-import
calid@arch ~/git/gradle
$ ./gradlew -q core:printOutputPath | /home/calid/git/vim-java-import/scripts/gen-import-index.pl -
DefaultProjectConfigurationActionContainerTest:org.gradle.configuration.project.DefaultProjectConfigurationActionContainerTest
DefaultGradleTest:org.gradle.invocation.DefaultGradleTest
DefaultTaskContainer:org.gradle.api.internal.tasks.DefaultTaskContainer
UnknownConfigurationException:org.gradle.api.artifacts.UnknownConfigurationException
DirectoryFileTree:org.gradle.api.internal.file.collections.DirectoryFileTree
PatternStepFactoryTest:org.gradle.api.internal.file.pattern.PatternStepFactoryTest
ModelConfigurationListener:org.gradle.initialization.ModelConfigurationListener
FilterChain:org.gradle.api.internal.file.copy.FilterChain
@calid
calid / rot13-shell-function
Last active February 1, 2023 05:51
rot13 implementations, first on the shell and then in Perl
calid@xen ~
[✔]▶ function rot13 { echo $1 | tr 'A-Za-z' 'N-ZA-Mn-za-m'; }
calid@xen ~
[✔]▶ rot13 'Fraq hf gur pbqr lbh hfrq gb qrpbqr guvf zrffntr'
Send us the code you used to decode this message
@calid
calid / ae_ev_explosion.out
Last active August 29, 2015 14:17
AnyEvent uses EV by default
t/fd.t .......... EV: error in callback (ignoring): zmq_msg_recv: Bad address at /home/calid/git/zmq-ffi/lib/ZMQ/FFI/ErrorHelper.pm line 83.
ZMQ::FFI::ErrorHelper::fatal(ZMQ::FFI::ZMQ3::Socket=HASH(0x200ced8), "zmq_msg_recv") called at /home/calid/git/zmq-ffi/lib/ZMQ/FFI/ZMQ3/Socket.pm line 125
ZMQ::FFI::ZMQ3::Socket::recv(ZMQ::FFI::ZMQ3::Socket=HASH(0x200ced8)) called at t/fd.t line 24
main::__ANON__(EV::IO=SCALAR(0x1a7dbe8), 1) called at /home/calid/.perlbrew/libs/perl-5.20.1@local/lib/perl5/x86_64-linux/AnyEvent/Impl/EV.pm line 88
eval {...} called at /home/calid/.perlbrew/libs/perl-5.20.1@local/lib/perl5/x86_64-linux/AnyEvent/Impl/EV.pm line 88
AnyEvent::CondVar::Base::_wait(AnyEvent::CondVar=HASH(0x1a7e2f0)) called at /home/calid/.perlbrew/libs/perl-5.20.1@local/lib/perl5/x86_64-linux/AnyEvent.pm line 1994
AnyEvent::CondVar::Base::recv(AnyEvent::CondVar=HASH(0x1a7e2f0)) called at t/fd.t line 49
^C
@calid
calid / 00-noprint-after-undef.pl
Last active August 29, 2015 14:17
Perl DESTROY Scoping Semantics
local *Foo::c = sub { print "IN MY C\n" };
my $f = Foo->new();
Foo::c();
Foo::d();
e();
undef $f;
__END__
Output
@calid
calid / 01-zmq_hang.py
Created March 19, 2015 00:56
pyzmq hanging on exit
import zmq
c = zmq.Context()
s = c.socket(zmq.DEALER)
s.connect('ipc://*')
s.send_string('ohhai')
s.send_string('ohhai')
s.send_string('ohhai')
print('Done')