Skip to content

Instantly share code, notes, and snippets.

@artemsky
artemsky / post-checkout
Last active September 2, 2022 13:36
Post merge git hook to check Laravel 5+ typical resources were updated
#!/bin/bash
# Looks for changes and automates running bundle and other tasks.
# Does not run if your local branch is behind the remote.
# https://gist.github.com/stefansundin/82051ad2c8565999b914
# post-checkout hook - looks for changes,
# when you change branches, and if found, reinstalls the given packages every
# Exit early if this was only a file checkout, not a branch change ($3 == 1)
[[ $3 == 0 ]] && exit 0
@hervenicol
hervenicol / run.tpl
Last active May 12, 2023 14:20 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name={{.Name}} \
{{range $e := .Config.Env}}--env={{printf "%q" $e}} \
{{end}}{{range $p, $conf := .NetworkSettings.Ports}}{{with $conf}}-p {{(index $conf 0).HostIp}}:{{(index $conf 0).HostPort}}:{{$p}} \
{{end}}{{end}}{{range $n, $conf := .NetworkSettings.Networks}}{{with $conf}}--network {{printf "%q" $n}} \
{{range $conf.Aliases}}--network-alias {{printf "%q" .}} {{end}} \
{{end}}{{end}}{{range $v := .HostConfig.VolumesFrom}}--volumes-from={{printf "%q" .}} \
{{end}}{{range $v := .HostConfig.Binds}}--volume={{printf "%q" .}} \
{{end}}{{range $l, $v := .Config.Labels}}--label {{printf "%q" $l}}={{printf "%q" $v}} \
{{end}}{{range $v := .HostConfig.CapAdd}}--cap-add {{printf "%q" .}} \
@3D-I
3D-I / sos_admin30.php
Created May 8, 2016 00:52
For phpBB 3.0.x - Gives a SOS admin account in order to fix some things.
<?php
/**
* Usage: --> make sure you have a backup of your Database before to run this tool!
* Download and/or unzip the file, upload it to your Board's root (i.e.: www.mydomain.com/phpBB3/)
* Point your browser to i.e.: www.mydomain.com/phpBB3/sos_admin30.php), it auto-destroys itself once ran.
*
* This file will create an admin user named Admin1 with a password of admin. From that point you should be
* able to get into the ACP.
* As soon as you have done this, use the temporary admin account to change the details on the original admin
* account, then delete the temporary account.
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active March 27, 2024 03:47
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@LeCoupa
LeCoupa / casperjs.cheatsheet.js
Last active January 23, 2022 07:56
Cheatsheet: CasperJS, PhantomJS & Spooky --> https://github.com/LeCoupa/awesome-cheatsheets
// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });