Skip to content

Instantly share code, notes, and snippets.

View ellefsen's full-sized avatar

Kim Ellefsen ellefsen

View GitHub Profile
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width"/>
</head>
<body style="height: 300vh">
<svg style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);"
width="655" height="209" viewBox="0 0 655 209" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M653 207V62C653 28.8629 626.228 2 593.091 2C519.318 2 391.639 2 292.675 2C270.583 2 252.717 19.9124 252.717 42.0038C252.717 63.5378 252.717 81.7221 252.717 81.7221C252.717 81.7221 252.717 81.7221 252.717 81.7221V167C252.717 189.091 234.808 207 212.717 207H2"
stroke="#EAECF0" stroke-width="4" stroke-linecap="round"/>
@ellefsen
ellefsen / Procfile
Last active October 28, 2020 02:47
Heroku with Google Cloud SQL and cloud_sql_proxy with PHP / Laravel
web: (bash ./start.sh) & vendor/bin/heroku-php-nginx public/
@ellefsen
ellefsen / nginx.conf
Created December 5, 2017 14:26 — forked from thoop/nginx.conf
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@ellefsen
ellefsen / Index.vue
Created August 15, 2017 17:05
Vue User Loaded
<template>
<new-component :user="user" v-if="user"></new-component>
</template>
<script>
import { mapGetters } from 'vuex'
import NewComponent from '@/components/NewComponent'
export default {
components: {
@ellefsen
ellefsen / acf.php
Last active March 21, 2017 19:30
Add ACF fields to WordPress Page Meta field
<?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
ellefsen / routes.php
Created August 17, 2016 09:08 — forked from tommymarshall/routes.php
Simple Laravel + Craft integration
<?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.
@ellefsen
ellefsen / class-developer-import.php
Created April 11, 2016 20:02 — forked from tomazzaman/class-developer-import.php
Import JSON into WordPress
<?php
// Published under GPL
// tutorial here: https://codeable.io/community/how-to-import-json-into-wordpress/
class Developer_Import {
public function __construct() {
add_action( 'wp_ajax_import_developer', array( $this, 'import_developer' ) );
@ellefsen
ellefsen / nginx.conf
Created January 9, 2016 15:18 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# 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
#!/bin/bash
######
# this script uses s3cmd from http://s3tools.org/s3cmd 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
######