Skip to content

Instantly share code, notes, and snippets.

View chriscz's full-sized avatar
🍎
vs 🍊

Chris Coetzee chriscz

🍎
vs 🍊
  • Activitar
  • Brisbane, Australia
  • 08:54 (UTC +10:00)
View GitHub Profile
@gmolveau
gmolveau / docker_quick_run.sh
Last active April 14, 2024 06:56
Quickly run a temporary docker container and execute bash to try things (like a CI script)
docker run --rm -it -v $PWD:/tmp debian:10-slim /bin/bash
# --rm : remove after exit
# -it : interactive TTY
# -v : mount folder : current folder to /tmp folder of the container
# debian:10-slim : docker image https://git.io/JJzfy
# /bin/bash : run bash in this container
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@jschroed91
jschroed91 / installopenssh76.sh
Last active October 3, 2020 08:50
Install openSSH 7.6 on Ubuntu 14.04
#!/bin/bash
echo "Installing deps..."
sudo apt-get install libssl-dev zlib1g-dev libpam0g-dev xz-utils
sudo apt-get remove openssh-server
echo "Downloading and extracting sources..."
wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.6p1.tar.gz
wget http://www.linuxfromscratch.org/patches/downloads/openssh/openssh-7.6p1-openssl-1.1.0-1.patch
tar -xf openssh-7.6p1.tar.gz
@Papierkorb
Papierkorb / 000_HOWTO.md
Last active March 9, 2024 17:59
Dynamic library in Crystal

Writing a dynamic library in Crystal, and calling it from C

  • Download all files.
  • Build the Crystal part:
crystal build --release --cross-compile --prelude ./no_main library.cr
              ^ You can leave this out
                        ^ We want to link ourselves!
 ^ Use our custom prelude!
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 26, 2024 16:33 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@alexvcasillas
alexvcasillas / github-store.js
Created May 4, 2017 08:35
Async Fetching with MobX Actions
import fetch from 'node-fetch';
import { observable, action, runInAction } from 'mobx';
export default class GithubStore {
@observable searchName;
@observable user;
@observable repos;
@observable fetchingData;
constructor() {
@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

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

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@phansch
phansch / yardoc_cheatsheet.md
Last active March 1, 2024 18:17 — forked from chetan/yardoc_cheatsheet.md
Improved YARD cheatsheet
@rtfpessoa
rtfpessoa / lazy-load-nvm.sh
Created August 26, 2016 11:42
NVM lazy loading script
#!/bin/bash
#
# NVM lazy loading script
#
# NVM takes on average half of a second to load, which is more than whole prezto takes to load.
# This can be noticed when you open a new shell.
# To avoid this, we are creating placeholder function
# for nvm, node, and all the node packages previously installed in the system
# to only load nvm when it is needed.
@carlflor
carlflor / Gemfile-lock-fix.md
Created May 25, 2016 07:03
This fixes the Gemfile.lock conflict when doing git rebase

If both the upstream and your feature branch have made changes to Gemfile, you will likely receive merge conflicts on Gemfile.lock when you rebase your feature branch. Don't try to resolve these manually; you'll probably just screw it up. Instead do this:

    git checkout --ours Gemfile.lock
    bundle
    git add Gemfile.lock
    git rebase --continue

This ensures that you get a correct Gemfile.lock at each step along the way.