Skip to content

Instantly share code, notes, and snippets.

@FlipperPA
FlipperPA / virtualenvwrapper-venv-aliases.sh
Last active June 14, 2023 16:56
Shortcuts for Python 3's venv for virtualenvwrapper users.
export VENV_HOME=~/.venvs
export VENV_PYTHON=/usr/bin/python3.6
fn_workon() {
if [ -f "${VENV_HOME}/${1}/bin/activate" ]; then
export VENV_CURRENT="${VENV_HOME}/${1}"
# Run commands before activation
if [ -f "${VENV_CURRENT}/pre_activate.sh" ]; then
. "${VENV_CURRENT}/pre_activate.sh"
fi
@Neo23x0
Neo23x0 / audit.rules
Last active January 13, 2024 14:12
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@maxrimue
maxrimue / readme.md
Last active March 13, 2021 12:21
Use yarn with Greenkeeper

Use yarn with Greenkeeper

When using yarn, it will create a yarn.lock lockfile which holds data on your used dependencies. This file also includes hard-typed versions, so should you update your dependencies, the yarn.lock file is basically outdated and needs to be regenerated. While yarn does this automatically, Greenkeeper pull requests that update dependencies as of right now do not do this regeneration, which means you would have to do it manually.

This gist shows you a way how to automatise this step using a Travis CI script.

Prerequisites

  • You use Travis CI and have it build Pull Requests (default behaviour)
  • You have a yarn.lock file in your repository for Travis CI to automatically install yarn (yarn will be added to their default images soon)

Getting started

======================== DEP XXX: Simplified routing syntax

  • DEP: XXX
  • Author: Tom Christie
  • Implementation Team: Tom Christie
  • Shepherd: Tim Graham
  • Status: Draft
  • Type: Enhancement
@jarpy
jarpy / requirements.txt
Last active June 30, 2022 06:28
Serverless Elasticsearch Curator for AWS Lambda
certifi==2016.8.8
elasticsearch-curator==4.0.6
PyYAML==3.11
@tomdale
tomdale / deploy.js
Created December 22, 2015 03:32
Script for deploying zip of FastBoot build to S3
#!/usr/bin/env node
var AWS = require('aws-sdk');
var RSVP = require('rsvp');
var exec = RSVP.denodeify(require('child_process').exec);
var fs = require('fs-promise');
var chalk = require('chalk');
var crypto = require('crypto');
@pixelhandler
pixelhandler / ember-cli-upgrade-1.13.8-to-1.13.13.sh
Last active December 6, 2015 22:49
Bash script to update dependencies (based on release notes) for an ember-cli app or addon, v1.13.8 -> v1.13.13
#!/usr/bin/env bash
# Use with arg $1 as --app or --addon and optional arg $2 as --backup to keep a copy of the original files
#
# Upgrade Ember-CLI dependencies from 1.13.8 to 1.13.13
#
# - https://github.com/twokul/ember-cli-release-notes/commit/1cee41eb91bf7c534917fdd4cd42a1cd1a481c75
# - https://github.com/ember-cli/ember-cli/releases/tag/v1.13.12
# - https://github.com/ember-cli/ember-cli/releases/tag/v1.13.13
@ef4
ef4 / select.hbs
Last active October 7, 2021 09:41
Goodbye old Select View
<select onchange={{action (mut vehicle) value="target.value"}}>
{{#each vehicles key="@item" as |vehicleChoice|}}
<option value={{vehicleChoice}} selected={{eq vehicle vehicleChoice}}>{{vehicleChoice}}</option>
{{/each}}
</select>
@paulirish
paulirish / bling.js
Last active April 20, 2024 17:39
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@justmoon
justmoon / custom-error.js
Last active April 22, 2024 17:19 — forked from subfuzion/error.md
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);