This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
background: repeating-linear-gradient(to right, $white, $white 20px, $bg-grey 20px, $bg-grey 130px); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//loops through each array by key, so $quotes[0] replaces $replace[0] | |
$quotes = ["\\'",'\\"']; | |
$replace = ["'",'"']; | |
$newsletter_article_html = str_replace($quotes, $replace, $newsletter_article_html); | |
return $newsletter_article_html; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.htaccess file will need the following: | |
RewriteEngine On | |
RewriteCond %{HTTP:X-Forwarded-SSL} !on | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
run this sql: | |
UPDATE wp_posts SET `post_content` = REPLACE (`post_content`, 'src="http://digitalbureau.com', 'src="https://digitalbureau.com'); | |
UPDATE digitalbureau_com.wp_posts SET `guid` = REPLACE (`guid`, 'http://digitalbureau.com', 'https://digitalbureau.com') WHERE post_type = 'attachment'; | |
src: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#this creates generic ssl certs (will be unsafe, but usuable for local) for any local servers that use ssl_certificate in their nginx conf | |
#!/bin/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#create domain with https, set up certs, test individually | |
#then create a website as same domain, but without https, add htaccess with values below in webapp location | |
RewriteEngine On | |
RewriteCond %{HTTP:X-Forwarded-SSL} !on | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function_to_execute(){ | |
//this schedules the event (time+3 seconds) with arguments that are passed to the function | |
wp_schedule_single_event( time() + 3, 'my_action', array($permalink) ); | |
spawn_cron(); | |
} | |
//this is the task that gets added via add_action, should go in functions.php or other parent-level functions file | |
function my_task($permalink) { | |
echo $permalink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/12265729/what-are-the-consequences-of-using-receive-denycurrentbranch-in-git | |
steps: | |
on remote - | |
git init | |
git config receive.denyCurrentBranch updateInstead | |
This will overwrite anything currently in the directory with a push from local | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var checker = ['attain-location-address-1', 'attain-location-address-2', 'attain-location-city', 'attain-location-state', 'attain-location-zipcode'] | |
for (var i = 0; i < checker.length; i++) { | |
if (!result['custom_fields'].hasOwnProperty(checker[i])) { | |
result['custom_fields'][checker[i]] = []; | |
result['custom_fields'][checker[i]][0] = ''; | |
} | |
} | |
return result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var origin1 = new google.maps.LatLng(55.930385, -3.118425); | |
var origin2 = 'Greenwich, England'; | |
var destinationA = 'Stockholm, Sweden'; | |
var destinationB = new google.maps.LatLng(50.087692, 14.421150); | |
var service = new google.maps.DistanceMatrixService(); | |
service.getDistanceMatrix( | |
{ | |
origins: [origin1, origin2], | |
destinations: [destinationA, destinationB], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#run this to open things with sublime: | |
#ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime | |
#open profile | |
alias profile="sublime ~/.bash_profile" | |
alias reloadprofile="source ~/.bash_profile" | |
#manage wifi | |
alias wifion="networksetup -setairportpower airport on" | |
alias wifioff="networksetup -setairportpower airport off" |