Skip to content

Instantly share code, notes, and snippets.

View KruegerDesigns's full-sized avatar

Adam Krueger KruegerDesigns

View GitHub Profile
<?php
// Comment out this variable when you are ready to use this webhook:
$Google_data = '{
"lead_id": "NDAwMDAwMDAwMDA6bGVhZF9pZDoxNTg4OTgxNjA1ODIw",
"user_column_data": [{
"column_name": "User Phone",
"string_value": "+16505550123",
"column_id": "PHONE_NUMBER"
},
<?php
// Why? After consolidating mutliple typekit accounts into one account,
// typekit renamed all our font-family CSS properties with a `-1` at the end of each font name.
//
// Story / Logic:
// If, string has no capitals, and string has no spaces,
// and string is not `serif` or `sans-serif`,
// then duplicate the true results and add `-1` to the end of each match...
// finally, add new font family name that matched to the beginning of the string of fonts.
require 'uri'
require 'net/http'
require 'net/https'
require 'json'
require 'csv'
lucid_sites_csv = CSV.parse(File.read("../all-sites.csv"), headers: true)
airtable_csv = CSV.open("../import-to-airtable.csv", "wb")
airtable_csv << ["Domain Name","Domain Pointed at Einstein?","Has SSL? ...154","Current Git Repo Branch","Active EIS Client?","EIS Primary Domain","Lucid Theme","Lucid Status","Lucid License Expiration","Site Live?"]
@KruegerDesigns
KruegerDesigns / ipstack-country-redirect.js
Created November 20, 2019 03:44
Redirect traffic based on IP Geo Location with api.ipstack.com
var getJSON = function(url, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;

Keybase proof

I hereby claim:

  • I am kruegerdesigns on github.
  • I am whaafflez (https://keybase.io/whaafflez) on keybase.
  • I have a public key ASDbhJftXkEYBLxHIX7pQVqgMoWkBkfMib4SFx6FI0pWDgo

To claim this, I am signing this object:

@KruegerDesigns
KruegerDesigns / beiber-game
Created April 3, 2015 00:11
Javascript game I compiled over at codecademy.com
// Check if the user is ready to play!
confirm("Are you ready to play?");
var age = prompt("What's your age");
if(age <= 13) {
console.log("We're sorry, you are too young to play.");
} else {
console.log("Awesome! " + age + " is old enough to play!");
}
@KruegerDesigns
KruegerDesigns / email_validation
Created March 23, 2015 23:04
Simple and lightweight jQuery email validation.
<!-- Add the styles below to your CSS file -->
<style>
input.email-error {
color: #C24C4C;
}
</style>
<!-- Add the jQuery below to your Javacript file -->
<script>
$(document).ready( function(){
@KruegerDesigns
KruegerDesigns / gulpfile.js
Last active August 29, 2015 14:15
Start processing less files with this Gulp file! Also supports minified CSS and LiveReload watching.
// Run "npm init" and fill out the wizard
// Then run the following to install all dependancies:
// npm install gulp gulp-util gulp-plumber gulp-less gulp-cssmin gulp-concat gulp-rename gulp-livereload
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var gutil = require('gulp-util');
var plumber = require('gulp-plumber');
@KruegerDesigns
KruegerDesigns / image-resolutions.js
Last active August 29, 2015 14:10
See which images were resized. Great for CMS sites where the client uses a full resolution image.
window.onload = function() {
// All images on page as an array
var image = document.images;
// Loop trough each image and return its height/width values
for (var i = image.length - 1; i >= 0; i--) {
image[i].style.outline = "3px solid orange";
image[i].scrollIntoView();
alert("Image height: " + image[i].height + "px \n" + "Image width: " + image[i].width + "px \n" + "Original height: " + image[i].naturalHeight + "px \n" + "Original width: " + image[i].naturalWidth + "px \n");
@KruegerDesigns
KruegerDesigns / toggle-menu.js
Last active August 29, 2015 14:05
Toggle Menu for jQuery
// Hides the menu
$(".menu").hide;
// This toggles the menu's visibility on/off, with a fade feature
$( ".toggle-button" ).on( "click", function() {
event.stopPropagation();
$(".menu").fadeToggle( "fast" );
});
// This fades out the menu when the user clicks outside of the menu area