Skip to content

Instantly share code, notes, and snippets.

@sfabijanski
sfabijanski / esrislurp.js
Last active August 29, 2015 14:23
Esrislurp example that runs to completion on newer versions of Node. Addition of new http agent with `keepalive: true` to keep the socket pool open for reuse
/*
* esrislurp
* https://github.com/steveoh/esrislurp
*
* Copyright (c) 2014 steveoh
* Licensed under the MIT license.
*/
'use strict';
var fs = require('fs'),
@sfabijanski
sfabijanski / 01-synaptics.conf
Last active November 6, 2015 14:54
Synaptics setup for T440S
# /etc/X11/xorg.conf.d/01-synaptics.conf
# use case: I never use middle click. I want the entire clickpad
# available for mouse movements and don't need the secondary buttons for right click.
# I trigger right-clicks with two fingered clicks and use two-fingered scrolling.
# I need to prevent my palm from making the cursor jump around when typing
Section "InputClass"
Identifier "t440 top buttons"
MatchDriver "synaptics"
# turn of all SoftButton Areas explicitly
Option "SoftButtonAreas" " 0 0 0 0 0 0 0 0"
@sfabijanski
sfabijanski / post-merge
Last active June 24, 2016 19:01 — forked from mariusGundersen/post-checkout
Save the post-merge file to the .git/hooks directory inside the repository folder. After each 'git pull' it will run 'npm install' if necessary and build the client files.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` or `git checkout` if a specified file was changed
# Run `chmod +x post-checkout` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && echo " * changes detected in $1" && echo " * running $2" && eval "$2"
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` or `git checkout` if a specified file was changed
# Run `chmod +x post-checkout` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && echo " * changes detected in $1" && echo " * running $2" && eval "$2"
@sfabijanski
sfabijanski / example.iisnode.yml
Created May 23, 2018 21:24
Example iisnode.yml file that sets node_env to production, overriding the local web.config file.
# ============================================================================
# Make a copy of this file and name it iisnode.yml if you want to use it for overrides.
# ============================================================================
# The optional iisnode.yml file provides overrides of the iisnode configuration settings specified in web.config.
# node_env - determines the environment (production, development, staging, ...) in which
# child node processes run; if nonempty, is propagated to the child node processes as their NODE_ENV
# environment variable; the default is the value of the IIS worker process'es NODE_ENV
# environment variable
@sfabijanski
sfabijanski / app.js
Created June 2, 2018 13:55 — forked from raddeus/app.js
Basic Express 4.0 Setup with connect-flash
var express = require('express');
var session = require('express-session');
var cookieParser = require('cookie-parser');
var flash = require('connect-flash');
var app = express();
app.use(cookieParser('secret'));
app.use(session({cookie: { maxAge: 60000 }}));
app.use(flash());
@sfabijanski
sfabijanski / sql_table_info.sql
Last active October 26, 2018 14:25
A script to size up the tables in your SQL Server database
-- pulled from: https://stackoverflow.com/questions/7892334/get-size-of-all-tables-in-database
SELECT
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows AS RowCounts,
SUM(a.total_pages) * 8 AS TotalSpaceKB,
CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS TotalSpaceMB,
SUM(a.used_pages) * 8 AS UsedSpaceKB,
CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS UsedSpaceMB,
@sfabijanski
sfabijanski / vs_code_azure_functions_on_fedora_30.md
Created June 28, 2019 18:31
Setting VS Code to use Azure Function extension on Fedora 30

Getting Started with Azure Functions in VS Code on a Fedora 30 workstation

The Azure Functions extension requires the installation of .Net Core to run properly and the Azure Functions Core Tools. These instructions walk through the proper steps required to get extension running properly on a Fedora 30 workstation.

First ensure .Net Core is in place

dotnet --version

The install for the Function Core Tools requires at least the 2.2 SDK

Installing the .Net core SDK from a Copr Repository

@sfabijanski
sfabijanski / example_polygon_clip_toolbox.pyt
Created April 24, 2020 21:03
A basic Esri Python Toolbox which takes an input polygon and clips a network stored featureclass that icludes parcels features, returning the clipped features back to the caler.
# A basic Python Toolbox script that takes a polygon as input and returns back
# a collection of parcel features clipped by the incoming polygon
# refer to https://gist.github.com/sfabijanski/b599ad795c0f573d88202e122ab19275 for information
# on the polygon template
# import arcpy
from arcpy import (
AddMessage,
da,
Delete_management,
Dissolve_management,
@sfabijanski
sfabijanski / cntlm_setup.md
Last active June 25, 2020 08:03
Installing and settng up cntlm to work behind an NTLMv2 corporate proxy

Some web proxies use NTLMv2 authentication to pass user domain credentials to the proxy before accessing the internet. A number of the command line tools (npm, bower, curl) need to have their proxy configurations set and don't handle the NTLM handoff well. Installing and configuring the tools to use cntlm.exe as a local proxy alleviates the problem.

Requirements

  • cntlm.exe
  • git for windows ( with gitBash )