Skip to content

Instantly share code, notes, and snippets.

View KillerDesigner's full-sized avatar

Steven Place KillerDesigner

View GitHub Profile
@KillerDesigner
KillerDesigner / gw-gravity-forms-map-fields-to-field.php
Created November 23, 2019 20:05 — forked from spivurno/gw-gravity-forms-map-fields-to-field.php
Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field
<?php
/**
* Gravity Wiz // Gravity Forms // Map Submitted Field Values to Another Field
*
* Usage
*
* 1 - Enable "Allow field to be populated dynamically" option on field which should be populated.
* 2 - In the "Parameter Name" input, enter the merge tag (or merge tags) of the field whose value whould be populated into this field.
*
* Basic Fields
@KillerDesigner
KillerDesigner / Car Manufacturers.json
Created February 26, 2019 02:06 — forked from pcgeek86/Car Manufacturers.json
Plain-text list of major car manufacturers
[
"Abarth",
"Alfa Romeo",
"Aston Martin",
"Audi",
"Bentley",
"BMW",
"Bugatti",
"Cadillac",
"Chevrolet",
@KillerDesigner
KillerDesigner / meta-tags.md
Created September 26, 2018 20:07 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) {
var R = 6371; // Radius of the earth in km
var dLat = deg2rad(lat2-lat1); // deg2rad below
var dLon = deg2rad(lon2-lon1);
var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c; // Distance in km
return d;
}
@KillerDesigner
KillerDesigner / _gf_toggle.scss
Created August 25, 2018 22:09 — forked from kjtolsma/_gf_toggle.scss
CSS3 toggle switch for Gravity Forms
// Gravity Forms checkbox toggle
// @use .pt-toggle
$pt-toggle-height: 32px;
$pt-toggle-border: 4px;
$pt-toggle-radius: 60px;
$pt-color-grey: #ddd;
$pt-color-white: #fff;
$pt-color-primary: #5cb85c;
.slippery:hover {
background-position: bottom center!important;
transition: background-position 5s linear 0s;
}
margin-left: auto!important;
margin-right: auto!important;
transition: background-position 1.5s ease-out 0.5s;
background-position: top center;
background-size: 100% auto!important;
height: 100%;
background-repeat: no-repeat;
@KillerDesigner
KillerDesigner / yoast_seo_primary_category_disable.php
Created February 17, 2018 21:03 — forked from amboutwe/yoast_seo_primary_category_disable.php
Disable Yoast SEO Primary Category Feature
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Disable Yoast SEO Primary Category Feature
* Credit: Yoast development team
* Last Tested: Jan 24 2017 using Yoast SEO 4.1 on WordPress 4.7.1
*/
add_filter( 'wpseo_primary_term_taxonomies', '__return_empty_array' );
@KillerDesigner
KillerDesigner / Open iterm tab here
Created January 29, 2017 23:22 — forked from eric-hu/Open iterm tab here
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder. To use: (1) Open Automator (2) Create a new service (3) Change "Service receives selected" drop downs to "Files or folders" in "Finder" (4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer:
@KillerDesigner
KillerDesigner / MainActivity.java
Created January 3, 2017 18:27 — forked from ishitcno1/MainActivity.java
Detect android device screen on, screen off and user present, then to do something.
public class MainActivity extends Activity {
private ScreenStateReceiver mReceiver;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
IntentFilter intentFilter = new IntentFilter(Intent.ACTION_SCREEN_ON);
intentFilter.addAction(Intent.ACTION_SCREEN_OFF);