Skip to content

Instantly share code, notes, and snippets.

View eiriksm's full-sized avatar
💭
I may be slow to respond.

Eirik Stanghelle Morland eiriksm

💭
I may be slow to respond.
  • Frontkom / Violinist.io
  • Trondheim, Norway
  • 22:02 (UTC +02:00)
  • X @orkj
View GitHub Profile
@eiriksm
eiriksm / vcl
Last active August 29, 2015 14:08
Drupal 8 and varnish
if (req.http.host == "crashndash.com") {
unset req.http.Cookie;
}
@eiriksm
eiriksm / drupal-vhost-install.sh
Created July 27, 2014 16:46
virtual host ++ drupal
#!/bin/bash
# Configuration
VHOST_CONF=/etc/apache2/sites-available/
ROOT_UID=0
WWW_ROOT=/var/www
MYSQL=`which mysql`
DRUSH=`which drush`
# If you don't use drush aliases, uncomment this.
DRUSHRC=/home/MYUSERNAME/.drush/aliases.drushrc.php
@eiriksm
eiriksm / nodes.services.js
Last active August 29, 2015 14:04
Creating nodes with services module
function getLocationAndPost() {
'use strict';
navigator.geolocation.getCurrentPosition(function (position) {
var url = 'http://example.com/enpoint' + '/node.json'; //endpoint URL
var lat = position.coords.latitude;
var lon = position.coords.longitude;
var date = new Date();
var timestamp = Math.round(date.getTime() / 1000);
var node_object = {
"type": "some_type", //set this to your content type
<?php
$style = '';
foreach($styles as $stylesheet) {
if (strpos($stylesheet['data'], 'system/system.menus.css') > 0) {
// Skip this one, at least for my theme.
continue;
}
// The following are nicked from Drupal core.
$contents = drupal_load_stylesheet($stylesheet['data'], TRUE);
@eiriksm
eiriksm / gist:a82f797a40d7b7466027
Created July 27, 2014 11:42
ssh to drush sql-cli
$ ssh [email protected] "drush --root=/path/in/remote/server sql-dump" | drush sql-cli