#!/usr/bin/env ruby | |
# Smarter be for ruby projects that prioritizes local project binstubs | |
# - uses zsh when needed, assuming MacOS Catalina or later | |
# - save on your path | |
# - drop the .rb | |
# - chmod +x | |
# - always type `be <command>` and the right thing should happen | |
# | |
# - inspired by Justin Searls (@searls) |
So you want to commit changes generated by a GitHub Actions workflow back to your repo, and have that commit signed automatically?
Here's one way this is possible, using the REST API, the auto-generated GITHUB_TOKEN
, and the GitHub CLI, gh
, which is pre-installed on GitHub's hosted Actions runners.
You don't have to configure the git
client, just add a step like the one below... Be sure to edit FILE_TO_COMMIT
and DESTINATION_BRANCH
to suit your needs.
#!/usr/bin/env python | |
import os, os.path, stat, sys, base64 | |
# TOTP lib inlined | |
import time, hmac, base64, hashlib, struct | |
def pack_counter(t): | |
return struct.pack(">Q", t) |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need.
Thus, you should keep the .vim
directory along with your .vimrc
version-controlled.
But when you have plugins installed inside .vim/bundle
(if you use pathogen), or inside .vim/pack
(if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.
Initialize a git repository inside your .vim
directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:
cd ~/.vim
import ratpack.http.client.HttpClient; | |
import ratpack.test.embed.EmbeddedApp; | |
import javax.net.ssl.SniSslContext; | |
import java.net.URI; | |
class AppTest { | |
static void main(String[] args) throws Exception { | |
EmbeddedApp.fromHandler(ctx -> { | |
URI uri = URI.create("#### A URL POINTING TO A SERVER USING SNI SSL ####"); |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
package de.childno.example.ratpack; | |
import com.google.inject.AbstractModule; | |
import com.google.inject.Inject; | |
import com.google.inject.Provides; | |
public class ServiceModule extends AbstractModule { | |
@Override | |
protected void configure() { } |