Skip to content

Instantly share code, notes, and snippets.

View emmaly's full-sized avatar
🔄
Synchronizing everything, everywhere, all at once.

Emmaly emmaly

🔄
Synchronizing everything, everywhere, all at once.
View GitHub Profile
@emmaly
emmaly / gobuild.sh
Created November 5, 2017 07:37
Build all golang and devenv images
#!/bin/bash
PULL=
if [ "$1" == "--pull" ]; then
PULL=y
fi
for L in golang-devenv-base golang-devenv atom-golang-devenv devenv; do
echo ["$L"]
pushd "$L" >/dev/null
@emmaly
emmaly / xcd
Created February 5, 2018 18:37
OpenVZ helpers
# cd into a container on the host-side, optionally including a subdir within it
function xcd() {
VEID="$(vzlist "$1" | grep -v CTID | tr -s ' ' | cut -d' ' -f2)"
shift
[ -z "$VEID" ] && exit 1
cd /var/lib/vz/private/$VEID$*
}
### Keybase proof
I hereby claim:
* I am emmaly on github.
* I am emmaly (https://keybase.io/emmaly) on keybase.
* I have a public key ASDxVxurcqZ8ydkRxa6Z-iUTNPTwmK4J4s_USNuy493g-Ao
To claim this, I am signing this object:
so much depends upon a red wheel barrow glazed with rain water beside the white chickens
@emmaly
emmaly / GoogleForm-AppsScript-MailChimp-API-GDPR-Code.gs
Created December 6, 2018 07:40
Google Form Apps Script to create new subscriber in MailChimp via API including GDPR opt-in
// make sure you have added an event trigger for OnFormSubmit to run the onFormSubmit() function or this won't even run
var APIKEY = "1234567890abcdef1234567890abcdef-us11"; // your MailChimp API key
var LISTID = "ababababab"; // hint: not an integer
var GDPRID = "cdcdcdcdcd"; // hint: this seems to be unique per list, so you'll have to find this yourself
var FORMSHEETNAME = "Form Responses 1"; // your Google Sheets target sheet name (this is the likely name if you didn't change it)
var EMAILCOLUMN = 6; // the column number (1=first) that contains the email field name
var XTRAPARTCOLUMN = 5; // the column number (1=first) that contains the field name for whatever you want this field to be
var XTRAPARTNAME = "XTRAPART"; // the merge field name of the extra field you're storing in (you have to make this yourself; it's here as an example of how you might populate a custom field)
@emmaly
emmaly / app_models_user.rb
Last active December 25, 2018 06:23
Forced Autofollow on Login - diaspora
# replacement of `after_database_authentication` in `app/models/user.rb`
def after_database_authentication
# remove any possible remove_after timestamp flag set by maintenance.remove_old_users
unless self.remove_after.nil?
self.remove_after = nil
self.save
end
if AppConfig.settings.autofollow_on_join?
begin
@emmaly
emmaly / upgrade-diaspora.sh
Created July 27, 2019 09:09
Upgrade Diaspora Instance (Bitnami deployment)
#!/bin/bash
sudo /opt/bitnami/ctlscript.sh stop
cd /opt/bitnami/apps/diaspora/htdocs/
sudo -u bitnami git checkout Gemfile
sudo -u bitnami git checkout Gemfile.lock
sudo -u bitnami git pull
sudo -u bitnami git checkout v0.7.12.0
@emmaly
emmaly / boxarray.js
Created September 15, 2020 00:54
BOXARRAY
function isEmpty_(value) {
if (value == undefined) return true;
if (value == null) return true;
if (typeof value == "string" && value == "") return true;
if (typeof value == "number") return false;
return false;
}
/**
* Expands the array to match lengths, and forces them into arrays.
DISM.exe /Online /add-capability /CapabilityName:Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0
DISM.exe /Online /add-capability /CapabilityName:Rsat.BitLocker.Recovery.Tools~~~~0.0.1.0
DISM.exe /Online /add-capability /CapabilityName:Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0
DISM.exe /Online /add-capability /CapabilityName:Rsat.ServerManager.Tools~~~~0.0.1.0
@font-face {
font-family: SegoeUI;
src:
local("Segoe UI Light"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff2) format("woff2"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff) format("woff"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf) format("truetype");
font-weight: 100;
}