Skip to content

Instantly share code, notes, and snippets.

View joelpurra's full-sized avatar
🗺️
Working remotely

Joel Purra joelpurra

🗺️
Working remotely
View GitHub Profile
#!/bin/bash
# SPDX-License-Identifier: MIT
## Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# Lockable script boilerplate
@alx
alx / git.rb
Created December 6, 2010 14:24
Jekyll plugin to add Git activity inside a list
require 'git'
module Jekyll
class GitActivityTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
end
def render(context)
@textarcana
textarcana / git-log2json.sh
Last active March 1, 2024 05:26
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@jrom
jrom / nginx.conf
Created February 7, 2012 17:14
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active March 21, 2024 23:00
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@joelpurra
joelpurra / UrlCssHelper.cs
Created March 30, 2012 18:05
UrlCssHelper: A helper extending ASP.NET MVC3 with simple ID and CSS class generators for page level elements, to make per-page or per-feature CSS includes/rules simpler
//-----------------------------------------------------------------------
// <copyright file="UriCssHelper.cs" company="The Swedish Post and Telecom Authority (PTS)">
// Copyright (c) 2011, 2012 The Swedish Post and Telecom Authority (PTS)
// Developed for PTS by Joel Purra <http://joelpurra.se/>
// Released under the BSD license.
// </copyright>
//-----------------------------------------------------------------------
// https://gist.github.com/2253509
namespace JoelPurra.Web.Helpers
@joelpurra
joelpurra / README.md
Last active October 2, 2015 13:58
AutoCleanCallback: Automatic HTML input field cleaning onkeyup/onchange using jQuery
@joelpurra
joelpurra / jquery.validate.unobtrusive.dynamic.js
Created April 11, 2012 15:19
$.validator.unobtrusive.parseDynamicContent by XHalent, modified to keep a reference to the jQuery selector/context object
/// <reference path="../jquery-1.7.js" />
/// <reference path="../jquery.validate.js" />
/// <reference path="../jquery.validate.unobtrusive.js" />
// Originally by XHalent, @xhalent
// http://xhalent.wordpress.com/
// http://xhalent.wordpress.com/2011/01/24/applying-unobtrusive-validation-to-dynamic-content/
// Modified by Joel Purra
// http://joelpurra.com/
@joelpurra
joelpurra / MvcAnnotationHelper.cs
Created April 16, 2012 13:49
MvcAnnotationHelper: Helps output formatted HTML from model properties.
//-----------------------------------------------------------------------
// <copyright file="MvcAnnotationHelper.cs" company="The Swedish Post and Telecom Authority (PTS)">
// Copyright (c) 2011, 2012 The Swedish Post and Telecom Authority (PTS)
// Developed for PTS by Joel Purra <http://joelpurra.se/>
// Released under the BSD license.
// </copyright>
//-----------------------------------------------------------------------
// https://gist.github.com/2398934
namespace JoelPurra.Web.Helpers
@joelpurra
joelpurra / MvcScriptHelper.cs
Created April 16, 2012 13:52
MvcScriptHelper: Helps render multiple script blocks from multiple pages/layouts/partial views, in the expected order
//-----------------------------------------------------------------------
// <copyright file="MvcScriptHelper.cs" company="The Swedish Post and Telecom Authority (PTS)">
// Copyright (c) 2011, 2012 The Swedish Post and Telecom Authority (PTS)
// Developed for PTS by Joel Purra <http://joelpurra.se/>
// Released under the BSD license.
// </copyright>
//-----------------------------------------------------------------------
// https://gist.github.com/2398969
namespace JoelPurra.Web.Helpers