Skip to content

Instantly share code, notes, and snippets.

View alexmarles's full-sized avatar
🙃

Àlex Marlés alexmarles

🙃
View GitHub Profile
@geelen
geelen / gulpfile.js
Last active October 11, 2017 11:47 — forked from superhighfives/gulpfile.js
Harp with BrowserSync! Woo!
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var harp = require('harp');
/**
* Serve the Harp Site from the src directory
*/
gulp.task('serve', function () {
harp.server(__dirname + '/src', {
@stefansundin
stefansundin / install-pre-push.sh
Last active October 12, 2023 10:33
Git pre-push hook to prevent force pushing the master/main branch.
#!/bin/bash
# This script will install a Git pre-push hook that prevents force pushing the master/main branch.
# There are three variants that I have built:
# - pre-push: prevents force-pushing to master/main.
# - pre-push-2: prevents force-pushing to master/main depending on the remote (you need to edit the file!).
# - pre-push-3: prevents any type of pushing to master/main.
# Set the desired version like this before proceeding:
# FILE=pre-push
# Single repo installation:
@pjmartorell
pjmartorell / prepare-commit-msg
Created July 21, 2014 10:51
Prepend automatically a reference to the issue number to commit tasks
#!/usr/bin/env ruby
# Git commit-msg hook. Prepend a reference to the issue number of the branch name to commit tasks.
# If your branch name is in the numeric form "issue_12345", also prepend "refs #12345" to commit messages,
# unless "refs #12345" is manually provided inline.
#
# Place code into .git/hooks/prepare-commit-msg and give it executable permissions
# cd .git/hooks
# wget https://gist.github.com/pjmartorell/6456a5ffa7f7ff9d3195
# chmod 755 prepare-commit-msg
@zach-klippenstein
zach-klippenstein / ChangePassword.java
Last active May 15, 2024 14:33
The keystore password on Java keystore files is utterly pointless. You can reset it without knowing it, as shown by this code. Note that private keys are still secure, as far as I know. The JKS implementation is copyright Casey Marshall (rsdio@metastatic.org), and the original source is available at http://metastatic.org/source/JKS.java. I've in…
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{

Idiot-Proof Git Aliases