Skip to content

Instantly share code, notes, and snippets.

View JPKCom's full-sized avatar
🏠
Working from home

Jean Pierre Kolb JPKCom

🏠
Working from home
View GitHub Profile
@leommoore
leommoore / letsencrypt_ubuntu_nginx.md
Last active August 8, 2018 10:37
Letsencrypt Ubuntu 14.04 Nginx

#Letsencrypt Ubuntu 14.04 Nginx Letsencrypt (https://letsencrypt.org) is an initative which aims to increase the use of encryption for websites. It basically allows people to apply for free certificates provided that they prove the they control the requested domain.

Note: As of 8th March 2016 letsencrypt is still in public beta.

##Installation To install the client, clone the repostiory from github.

git clone https://github.com/letsencrypt/letsencrypt.git
@tomhodgins
tomhodgins / queryStrip.js
Last active February 12, 2019 20:58
Deeplink to bootstrap modals, tooltips, popovers, and tabs
$(document).ready(function(){
// queryStrip
function queryStrip(string) {
string = string.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + string + '=([^&#]*)'),
results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ''));
}
@TaoK
TaoK / jQuery.base64.js
Created January 12, 2012 18:23
jQuery BASE64 functions (yet another)
/**
* jQuery BASE64 functions
*
* <code>
* Encodes the given data with base64.
* String $.base64Encode ( String str )
* <br />
* Decodes a base64 encoded data.
* String $.base64Decode ( String str )
@robdvr
robdvr / gist:7451695
Created November 13, 2013 16:12
Adding Bootstrap Forms to WooCommerce
add_filter('woocommerce_billing_fields', 'custom_woocommerce_billing_fields');
function custom_woocommerce_billing_fields( $fields ) {
$fields['billing_address_1']['class'] = array( 'form-group' );
$fields['billing_address_1']['input_class'] = array( 'form-control' );
return $fields;
}
@georgebyte
georgebyte / background-color-picker.js
Last active September 13, 2020 20:13
jQuery: Background color picker (pick color from image by clicking on it)
var image = new Image();
image.src = "sample.jpg";
$(image).load(function() {
ctx.drawImage(image, 0, 0);
});
$(canvas).click(function(e) {
var canvasOffset = $(canvas).offset();
var canvasX = Math.floor(e.pageX-canvasOffset.left);
var canvasY = Math.floor(e.pageY-canvasOffset.top);
@makeusabrew
makeusabrew / label-to-placeholder.js
Created May 22, 2011 18:32
Simple jQuery snippet to convert form labels into inline placeholders
$("form :input").each(function(index, elem) {
var eId = $(elem).attr("id");
var label = null;
if (eId && (label = $(elem).parents("form").find("label[for="+eId+"]")).length == 1) {
$(elem).attr("placeholder", $(label).html());
$(label).remove();
}
});
@PaulKinlan
PaulKinlan / criticalcss.html
Last active March 15, 2023 02:13
Detect Critical CSS
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<h2>Original CSS</h2>
<style style="display: block; white-space: pre; font-family: monospace">
h2 { margin:0; }
@dhlavaty
dhlavaty / ramdisk-howto.md
Last active April 24, 2023 15:35
Create RAM disk in macOS High Sierra (10.13.3)

Create RAM disk in macOS High Sierra (10.13.3), macOS Monterey (12.6.5) with ARM processor

Update 2023-04-24

Tested on macOS Monterey (12.6.5) with Apple M1 Pro chip (ARM architecture)

LIST DISKS

@Superbil
Superbil / chromium_update.sh
Created September 16, 2010 16:22
auto update chromium on osx
#!/bin/bash
# Chromium update script
# - by shad <shad@zaphod.eu>
# - by superbil <help@superbil.info>
OS=mac
SITE=http://build.chromium.org/buildbot/snapshots/chromium-rel-
LATEST=$(wget -q -O - ${SITE}${OS}/LATEST)
INSTALL_DIR=/Applications
TARGET=Chromium
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages