Skip to content

Instantly share code, notes, and snippets.

@dsci
dsci / gist:1347672
Created November 8, 2011 12:52
Delete commits from repository.
# First, check out the commit you wish to go back to (get sha-1 from git log)
git reset --hard 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a
# Then do a forced update.
git push origin +9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a^:develop
# Push specific commit
git push origin 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a:develop -f
@alcidesqueiroz
alcidesqueiroz / git_commit_only_deleted_files
Created August 3, 2012 21:00
Git - Commit only deleted files...
git ls-files --deleted | xargs git rm
git commit
@adamloving
adamloving / temporary-email-address-domains
Last active July 24, 2024 20:49
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@jamshid
jamshid / update-hosts.sh
Last active June 18, 2023 18:05
Docker environment hack, to put the names of running containers in /etc/hosts
#!/bin/bash
# An alternative to "links", run this script after starting or stopping any
# container. It's a hack to update the host machine (vagrant) /etc/hosts with
# the current active docker containers and tell dnsmasq to refresh.
#
# Then start each machine with "-dns ${DOCKER_HOST_IP}", e.g.
# $ docker run -d -name mycontainer1 -dns 10.0.3.1 MYPRODUCT
# You can't seem to set the DNS during "docker build".
#
# Diagnostic command to run in host or while logged into containers:
@iwarner
iwarner / Checkout
Last active October 16, 2023 06:51
Simple Cart Stripe Installation
/**
* Stripe
*
* @param object opts Options Object
* @see https://support.stripe.com/questions/which-currencies-does-stripe-support
* @todo Make functions variables in this
*/
Stripe : function ( opts )
{
@pdparker
pdparker / APAstyle
Created June 17, 2015 23:17
APA Style for Markdown
/* I have only tested this on Chrome but it
prints nicely to A4 size */
@media print {
body {
width: 210mm;
height: 297mm;
}
}
#Copyright Alexander Somma
#Licensed under GPL
#taken from https://nosarthur.github.io/coding/2018/01/15/termux.html
#Before running install curl
#pkg install curl
#then call using: curl -fsSL
termux-setup-storage# it creates a folder called storage at your home folder which provides access to the Chromebook file systems (downloads, music, pictures, etc)
pkg install termux-exec# for better support for bash
@opencoca
opencoca / mautic_warmup.sh
Created March 18, 2020 13:36
Mautic Perms and Cache warm up
cd /var/www/mautic
mkdir app/spool/
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod -R g+w app/cache/
chmod -R g+w app/logs/
chmod -R g+w app/config/
chmod -R g+w media/files/
chmod -R g+w media/images/
chmod -R g+w translations/
@opencoca
opencoca / cheap-ai-chess.markdown
Created January 15, 2021 20:28
Cheap AI Chess!

Cheap AI Chess!

A wonderful opportunity to beat a computer at chess!

Play against a friend, a totally random AI, or wager money as it plays against itself. I'm sure there are still bugs in here but hey, happy new year.

Play together online using Mozilla's Together JS

A Pen by Alexander Somma on CodePen.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>capture microphone audio into buffer</title>
</head>
<body>
<audio id="player" controls></audio>
<input
type="text"
id="username"