Skip to content

Instantly share code, notes, and snippets.

@tomfanning
tomfanning / extract-pfx.sh
Created April 8, 2015 12:11
Shell script to extract certificate and key files suitable for nginx from a PFX file.
#!/bin/bash
set -e
if [ "$#" -ne 1 ]; then
echo "Usage: $0 filename.pfx" >&2
exit 1;
fi
if [ ! -e "$1" ]; then
echo "File not found: $1" >&2
@saulopaiva
saulopaiva / install-fuelphp.sh
Last active September 2, 2017 21:52 — forked from kenjis/install-fuelphp.sh
Instalação do FuelPHP usando submodules do Git
#!/bin/sh
# FuelPHP Install Script
#
# @author Kenji Suzuki https://github.com/kenjis
# @copyright 2011 Kenji Suzuki
# @license MIT License http://www.opensource.org/licenses/mit-license.php
if [ $# -lt 2 ]; then
echo "Install FuelPHP and Create Application Repository"
@kain-jy
kain-jy / gist:4238790
Created December 8, 2012 05:33
[nginx][config] fuelphp+php-fpm
server {
listen 80;
server_name host.example.com;
charset utf-8;
access_log /var/log/nginx/host.example.access.log main;
error_log /var/log/nginx/host.example.error.log;
index index.php;
@DiegoSalazar
DiegoSalazar / validate_credit_card.js
Last active February 21, 2025 13:22
Luhn algorithm in Javascript. Check valid credit card numbers
// Takes a credit card string value and returns true on valid number
function valid_credit_card(value) {
// Accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
let nCheck = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {