Skip to content

Instantly share code, notes, and snippets.

View iholler's full-sized avatar

Stephen King iholler

  • Knoxville, TN
View GitHub Profile
@scripting
scripting / sendToSlack.js
Last active July 9, 2022 13:03
A tiny JavaScript app that sends a message to your default Slack channel. Can be customized with a name, icon, emoji or sent to a different channel. Runs in Node.js.
var request = require ("request");
var urlWebHook = "https://hooks.slack.com/services/abcdef"; //the URL you get on your "incoming web hooks" page.
function sendToSlack (s, theUsername, theIconUrl, theIconEmoji, theChannel) {
var payload = {
text: s
};
if (theUsername !== undefined) {
payload.username = theUsername;
@tbrianjones
tbrianjones / download_file_to_client_computer.php
Last active October 28, 2021 02:49
Simple way to write data to a file and save it to a Client's computer when they click a link, using only PHP and HTML.
<?php
// this is a single page that can access and write any data to a file
// on a clients computer when they click a link using only HTML and PHP
//
// this will keep the data between page loads
session_start();
// download file if $_GET['download_file'] is set to true
@p3t3r67x0
p3t3r67x0 / prefixed-office-properties.md
Last active February 20, 2024 19:15
MS Office prefixed style properties can be used for older versions of MS Excel, MS PowerPoint or MS Word when you want to save a document, presentation, workbook, or worksheet as a web document, or even in older versions for MS Outlook.

MS Office prefixed style properties

mso-ansi-font-size

Note: Office only

mso-ansi-font-size: large | larger | <length> | medium | <percentage> | small | smaller | x-large | x-small | xx-large | xx-small
@jirutka
jirutka / -README.md
Last active October 31, 2023 09:07
How to use terminal on Windows and don’t go crazy…

How to use terminal on Windows without going crazy…

Windows is really horrible system for developers and especially for devops. It doesn’t even have a usable terminal and shell, so working with command line is really pain in the ass. If you really don’t want to switch to any usable system (OS X, Linux, BSD…), then this guide should help you to setup somewhat reasonable environment – usable terminal, proper shell, ssh client, git and Sublime Text as a default editor for shell.

Install stuff

  1. Download and install Git for Windows* with:
    • [✘] Use Git from the Windows Command Prompt
  • [✘] Checkout as-is, commit Unix-style line endings
@LeCoupa
LeCoupa / casperjs.cheatsheet.js
Last active January 23, 2022 07:56
Cheatsheet: CasperJS, PhantomJS & Spooky --> https://github.com/LeCoupa/awesome-cheatsheets
// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });
@LeaVerou
LeaVerou / gray.scss
Last active May 16, 2022 13:05
Polyfill gray() from CSS Color Level 4 with SASS
@function gray($intensity, $alpha: 1) {
@return rgba($intensity, $intensity, $intensity, $alpha);
}
/* Thanks Chris Eppstein for simplifying my code! */
/* Testing our new function */
body {
background: gray(50%);
background: gray(255, .2);
@joyrexus
joyrexus / README.md
Last active May 3, 2024 10:41 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@djKianoosh
djKianoosh / ie-shims.js
Created October 21, 2013 20:36
IE shims for array indexOf, string startsWith and string trim
// Some common IE shims... indexOf, startsWith, trim
/*
Really? IE8 Doesn't have .indexOf
*/
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
"use strict";
if (this === null) {
throw new TypeError();
@iholler
iholler / bluehollercreative-gmap-functions.js
Last active December 16, 2015 05:28
CUSTOM GMAP3 BUILD - Calculate distance from current location. Two Functions: 1. Loads map with markers for current location and a specified destination. 2. Re-loads the same map, but this time checks for the distance between the current location and the destination and checks to see if the user is within a given range. If true - returns an aler…
// Author: Stephen King
// Contact: stephen.curtis.k@gmail.com
// Credits: http://www.gmap3.net
// Created using Google maps and the "gmap3" framework.
/* =========================================================================================
AUTHOR NOTES
=========================================================================================
//LOAD initMap(); function at the end of your HTML document before the closing "body" tag.
LOAD destination(); function through a button's onclick="distance();"
@jdkanani
jdkanani / notepad.html
Last active April 6, 2024 17:09 — forked from jakeonrails/Ruby Notepad Bookmarklet
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`