Skip to content

Instantly share code, notes, and snippets.

View mhackersu's full-sized avatar
🐧
tokimeku

Mike Hacker mhackersu

🐧
tokimeku
View GitHub Profile
@mhackersu
mhackersu / shapefileConversion.md
Created November 1, 2017 22:40 — forked from YKCzoli/shapefileConversion.md
Step through of converting shapefile to geojson with qgis.

Converting shapefiles to geojson

####Assumptions

Get the data

We will use the Electoral District and Polling Division shapefiles found on the Elections Ontario site:

@mhackersu
mhackersu / index.html
Created December 19, 2017 06:32
Promise with Callback
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/1.2.2/bluebird.js"></script>
<title>JS Bin</title>
</head>
<body>
@mhackersu
mhackersu / express.js
Created January 11, 2018 00:37
A little Express.JS static HTTP server
+var express = require('express');
+var app = express();
+var server = require('http').Server(app);
+
+app.set('port', (process.env.PORT || 3000));
+
+app.use(express.static(__dirname + '/dist'));
+
+app.listen(app.get('port'), function() {
+ console.log('Node app on port', app.get('port'))
@mhackersu
mhackersu / gulpfile.js
Created January 11, 2018 00:38
A nice little Gulpfile for doing Front-End Development (SASS, Compression, Dist Build)
//initialize all of our variables
var app, base, concat, directory, gulp, gutil, hostname, path, refresh, sass, uglify, imagemin, minifyCSS, del, browserSync, autoprefixer, gulpSequence, shell, sourceMaps, plumber;
var autoPrefixBrowserList = ['last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'];
//load all of our dependencies
//add more here if you want to include more libraries
gulp = require('gulp');
gutil = require('gulp-util');
concat = require('gulp-concat');
@mhackersu
mhackersu / css-drawer.markdown
Last active October 16, 2019 22:11
CSS Drawer
@@ -28,7 +28,7 @@
if (!string.IsNullOrEmpty(_orderID))
{
string sql = @" select c.CustomerID, c.FirstName, c.LastName, c.Address, c.Address2, c.City, c.State, c.Zip, c.Country, c.PhoneNumber, c.Extension, c.EmailAddress, ROUND(o.OrderTotal, 2) AS OrderTotal
string sql = @" select c.CustomerID, c.FirstName, c.LastName, c.Address, c.Address2, c.City, c.State, c.Zip, c.Country, c.PhoneNumber, c.Extension, c.EmailAddress, ROUND(o.OrderTotal, 2) AS OrderTotal, o.OrderKey
from customers c
join orders o
on c.CustomerID = o.CustomerID
@mhackersu
mhackersu / call_fedex.asp
Created October 22, 2018 18:45
Calling a FedEx Rate Service from Classic ASP with SOAP
<% option explicit %>
<!--#include file="FedexAccountInfo.asp"-->
<%
Dim subscriberzip
Dim subscribercountry
Dim ShipmentDate
Dim xmlReq
Dim objhttp
Dim outstr
Dim NodeList
@mhackersu
mhackersu / functions.php
Created November 26, 2018 20:50 — forked from shivapoudel/functions.php
WooCommerce - Allow rendering of checkout and account pages in iframes
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_action( 'after_setup_theme', 'wc_remove_frame_options_header', 11 );
/**
* Allow rendering of checkout and account pages in iframes.
*/
@mhackersu
mhackersu / gist:919232e99aaec26afdeba08053ed0f6b
Created November 26, 2018 22:34 — forked from MindyPostoff/gist:00f623326db4daa50394
Custom URL for the Continue Shopping button in WooCommerce Cart
/**
* Redirect the Continue Shopping URL from the default (most recent product) to
* a custom URL.
* Place this code snippet in your theme's functions.php file.
*/
function custom_continue_shopping_redirect_url ( $url ) {
$url = "http://www.woothemes.com"; // Add your link here
return $url;
}
add_filter('woocommerce_continue_shopping_redirect', 'custom_continue_shopping_redirect_url');
/**
* Allow rendering of checkout and account pages in iframes.
*/
add_action( 'after_setup_theme', 'wc_remove_frame_options_header', 11 );
function wc_remove_frame_options_header() {
remove_action( 'template_redirect', 'wc_send_frame_options_header' );
}