Skip to content

Instantly share code, notes, and snippets.

View ianthekid's full-sized avatar

Ian Ray ianthekid

View GitHub Profile
@ianthekid
ianthekid / hexagon-image.css
Created May 29, 2021 16:05
hexagon-image.css
img {
clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}
<?php
function sendToSlack($lead, $sfdcId, $channel) {
$slack = [
"text" => '',
"username" => $lead['firstName']." ".$lead['lastName'],
"icon_emoji" => ':fire:',
"attachments" => [[
"color" => '#FA9100',
"title" => 'Open in Salesforce »',
"title_link" => "https://salesforce.com/r/Lead/".$sfdcId."/view",
#!/bin/sh
# BACKUP SCRIPT
# DATABASE
DBNAME="dbname"
DBUSER="dbuser"
DBPASS="dbpass"
# PATHS
DIRDB="/backup/db"
@ianthekid
ianthekid / google_play_music_to_spotify_playlist.js
Created September 28, 2018 21:07
Copy playlists from Google Play Music to Spotify
/*
* See instructions on this page: https://community.spotify.com/t5/Desktop-Windows/Import-Google-Music-playlists-to-Spotify/td-p/1173080/page/3
* Then access this site: http://spotlistr.herokuapp.com/#/search/textbox
*/
//Copy/Paste in web browser console on any public playlist page for Google Play Music
function fReplace(thisString, thisThing, thatThing) {
let tLS = thisString;
while(tLS.includes(thisThing)){
tLS = tLS.replace(thisThing, thatThing);
setDns domain.com 0.0.0.0
navigate http://domain.com/
@ianthekid
ianthekid / Attachment-Image-Comments.php
Last active November 24, 2015 06:25
Wordpress Comments for Attachment Images in Post Loop
<?php
//Place this within The Loop of post_parent ($post)
$args = array( 'post_type' => 'attachment',
'numberposts' => -1,
'post_parent' => $post->ID );
$attachments = new WP_query($args);
while ($attachments->have_posts()) :
@ianthekid
ianthekid / ubuntu-mouse-cursor
Last active September 6, 2015 01:12
ubuntu mouse cursor not showing
sudo modprobe -r psmouse
sudo modprobe psmouse
<?php
/****************************
*
* Lead Source Tracking
*
****************************
* @Author: Ian Ray
* @Created: 17-May 2015
* @Updated: 10-July 2015
* @Description: Created for use with Gravity Forms and Salesforce Lead Source field
@ianthekid
ianthekid / gist:ea34cc4fd8b908733192
Created June 29, 2015 17:37
git fetch and rebase
git fetch
git rebase origin/master
#Source: http://stackoverflow.com/questions/7200614/how-to-merge-remote-master-to-local-branch
#git merge branchname takes new commits from the branch branchname, and adds them to the current branch. If necessary, it automatically adds a "Merge" commit on top.
#git rebase branchname takes new commits from the branch branchname, and inserts them "under" your changes. More precisely, it modifies the history of the current branch such that it is based on the tip of branchname, with any changes you made on top of that.
@ianthekid
ianthekid / ios_bg.css
Last active August 29, 2015 14:18
Fix Background Size cover for iOS Safari stretching max 100%
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
.bg {
background-attachment: scroll !important;
}
}