Skip to content

Instantly share code, notes, and snippets.


Kim Ellefsen ellefsen

View GitHub Profile
ellefsen / Procfile
Last active Oct 28, 2020
Heroku with Google Cloud SQL and cloud_sql_proxy with PHP / Laravel
View Procfile
web: (bash ./ & vendor/bin/heroku-php-nginx public/
ellefsen / nginx.conf
Created Dec 5, 2017 — forked from thoop/nginx.conf
Official nginx.conf for nginx
View nginx.conf
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
root /path/to/your/root;
index index.html;
ellefsen / Index.vue
Created Aug 15, 2017
Vue User Loaded
View Index.vue
<new-component :user="user" v-if="user"></new-component>
import { mapGetters } from 'vuex'
import NewComponent from '@/components/NewComponent'
export default {
components: {
ellefsen / acf.php
Last active Mar 21, 2017
Add ACF fields to WordPress Page Meta field
View acf.php
* Add ACF to Post meta stuff.
function my_rest_prepare_post( $data, $post, $request ) {
$data->data['meta'] = array_merge($data->data['meta'], get_fields($post->ID));
return $data;
add_filter( 'rest_prepare_page', 'my_rest_prepare_post', 10, 3 );
ellefsen / routes.php
Created Aug 17, 2016 — forked from tommymarshall/routes.php
Simple Laravel + Craft integration
View routes.php
| Application Routes
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
View class-developer-import.php
// Published under GPL
// tutorial here:
class Developer_Import {
public function __construct() {
add_action( 'wp_ajax_import_developer', array( $this, 'import_developer' ) );
ellefsen / nginx.conf
Created Jan 9, 2016 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
# Command Line to run from terminal
# Logs result to file s3_backup.log
# Command will run in the background
s3cmd sync -v /path/to/folder/ s3://s3-bucket/folder/ > s3_backup.log 2>&1 &
# Crontab command to sync folder to S3
# Command will run 1am every day and logs result to /root/s3_backup.log
0 1 * * * /usr/bin/s3cmd sync -rv /path/to/folder/ s3://s3-bucket/folder/ >> /root/s3_backup.log
# this script uses s3cmd from to sync a folder in linux to s3
# make sure that you have configured s3cmd by running s3cmd --configure
# this script is usally kept in a cron to be run every x amount of hours