Skip to content

Instantly share code, notes, and snippets.

View malpaso's full-sized avatar

Bill Tindal malpaso

  • Melbourne, Australia
View GitHub Profile
@malpaso
malpaso / setup_ssh_windows.md
Created January 18, 2021 22:19
Setup SSH on Windows 10

Quick Steps for Impatient Users Like Me Enable the OpenSSH Authentication Agent service and make it start automatically. Add your SSH key to the agent with ssh-add on the command line. Test git integration, if it still asks for your passphrase, continue on. Add the environment variable $ENV:GIT_SSH=C:\Windows\System32\OpenSSH\ssh.exe to your session, or permanently to your user environment. Detailed Steps: Overview Windows has been shipping with OpenSSH for some time now. It includes all the necessary bits for ssh to work alongside Git, but it still seems to need some TLC before it works 100% seamlessly. Here's the steps I've been following with success as of Windows ver 10.0.18362.449 (you can see your Windows 10 version by opening a cmd.exe shell and typing ver).

I assume here that you already have your SSH key setup, and is located at ~/.ssh/id_rsa

@malpaso
malpaso / php_cheatsheet.php
Last active December 18, 2020 02:13
PHP Cheat Sheet
<?php
// Thanks to https://dev.to/rickavmaniac/my-beloved-php-cheat-sheet-7dl
//Naming convention
$first_name = 'Mike'. // all lower case with underscore separators
function updateProduct() // camelCase
class ProductItem // StudlyCaps
const ACCESS_KEY = '123abc'; // all upper case with underscore separators
@malpaso
malpaso / index.php
Created December 5, 2016 23:17 — forked from ajitbohra/index.php
mpdf: HTML/CSS to PDF & send pdf via email
<?php
/*
mPDF: Generate PDF from HTML/CSS (Complete Code)
*/
require_once( 'mpdf/mpdf.php'); // Include mdpf
$stylesheet = file_get_contents('assets/css/pdf.css'); // Get css content
$html = '<div id="pdf-content">
Your PDF Content goes here (Text/HTML)
</div>';
@malpaso
malpaso / S3Wrapper.cfc
Created September 7, 2016 02:37 — forked from christierney402/S3Wrapper.cfc
Amazon Web Services (AWS) S3 Wrapper for ColdFusion
/**
* Amazon S3 REST Wrapper
* Version Date: 2015-09-03
*
* Copyright 2015 CF Webtools | cfwebtools.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
UPDATE table SET slug = lower(name),
slug = replace(slug, '.', ' '),
slug = replace(slug, '\'', '-'),
slug = replace(slug, '/', '-'),
slug = replace(slug,'š','s'),
slug = replace(slug,'Ð','Dj'),
slug = replace(slug,'ž','z'),
slug = replace(slug,'Þ','B'),
slug = replace(slug,'ß','Ss'),
slug = replace(slug,'à','a'),
@malpaso
malpaso / jquery_prevent_form_enter_key.js
Created June 23, 2016 00:52
Prevent form submitting on Enter key (jQuery)
$(function() {
$('#formId').on('keyup keypress', function(e) {
var keyCode = e.keyCode || e.which;
if (keyCode === 13) {
e.preventDefault();
return false;
}
});
});