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
#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
#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
.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
//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
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
let randomColor = '#' + (Math.random() * 0xFFFFFF << 0).toString(16); |
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
let randomOpacity = (Math.random() * (0.50 - 1) + 1).toFixed(2); | |
// in react: | |
<p key={k} style={{opacity: randomOpacity}}> |
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
#config ssh: | |
#add rsa.pub to instance metadata | |
#1. go to gcloud instance, click edit | |
#2. go to 'custom metadata' section, add 'enable-oslogin':TRUE | |
#3. click 'show and edit' under SSH key section, add the contents outputted by command 'cat ~/.ssh/id_rsa.pub' to add your public ssh key (use the outputted username as the key here ex. benfausch) | |
#4. go to gcloud terminal through gcloud webpage, run 'mkdir .ssh && touch .ssh/authorized_keys', then authorized_keys > "your ouputted public ssh key here" | |
#5. go to normal terminal, then use same username gcloud uses in browser terminal (ex benjamin_fausch_gmail), your private SSH key, and the public IP of the instance | |
#=>=>=>=> ssh -i id_rsa benjamin_fausch@35.123.17.04 | |
#6. then you can just use ssh benjamin_fausch@35.xxx and create an alias |
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 marginArray = ['0', '-100%', '-200%']; | |
var i = 0; | |
jQuery('#prev').click(function() { | |
i--; | |
i === -1 ? i = 2 : i; | |
jQuery('.slider-container').css('margin-left', marginArray[i]); | |
}); | |
jQuery('#next').click(function() { | |
i++; |