Skip to content

Instantly share code, notes, and snippets.

View lslinnet's full-sized avatar
:shipit:
o.O

Lars Stadel Linnet lslinnet

:shipit:
o.O
View GitHub Profile
@lslinnet
lslinnet / synchronous-execution.js
Created December 7, 2017 07:43
Process all requests guaranteeing synchronous execution (e.g. 1 then 2 then 3)
function asyncFunction (item, cb) {
setTimeout(() => {
console.log('done with', item);
cb();
}, 100);
}
let requests = [1, 2, 3].reduce((promiseChain, item) => {
return promiseChain.then(() => new Promise((resolve) => {
asyncFunction(item, resolve);
@lslinnet
lslinnet / README.md
Last active June 15, 2016 11:08
Docker compose setup

Add db mc dblegacy solr01 to etc hosts pointing to 127.0.0.1 for drush to function.

underscores in file names indicates directories. e.g. docker_proxy_acl.vcl -> docker/proxy/acl.vcl

@lslinnet
lslinnet / .gitconfig
Last active August 29, 2015 14:15
.gitconfig and .gitignore files I use - based of drupal git configuration and a few other areas
# Sample gitconfig
#
# If you have hub install (github helper scripts)
[hub]
protocol = https
[user]
name = <your name as you want it in git commits>
email = <your email>
[branch]
@lslinnet
lslinnet / swap.sh
Created August 28, 2012 10:55
Bash based swap command to swap 2 directories
function swap()
{
local TMPFILE=tmp.$$
mv "$1" $TMPFILE
mv "$2" "$1"
mv $TMPFILE "$2"
}
@lslinnet
lslinnet / gist:1737528
Created February 4, 2012 12:24
heroicdeath.messages på dansk
#This file contains custom messages for death events.
#You can specify as many messages as you want (within reason) for each death type.
#Just be sure each message is on a new line under the appropriate label.
#When a player dies, a random message from the appropriate label is chosen.
#Accepted variables:
# - %d holds the name of the dead player.
# - %a holds the name of the attacking entity (player or monster) for PVP and Monster deaths.
# - %i holds the name of the attacking player's current item for PVP deaths.
#Custom item names may be defined in the 'heroicdeath.items' file.
:Drown
<?php
// $Id$
?>
<?php if($content->module == "nodequeue") : ?>
<?php foreach ($content->content as $article) : ?>
<div class="article article-with-teaser-large <?php print $content->css_class; ?>">
<?php
$options = array(
// array('type' => 'image', 'preset' => mjm_get_preset($content->css_class)),
array('type' => 'title', 'element' => 'h2', 'link' => TRUE),
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is C:\mysql\data) or
.pic-pos-dropdown {
background-color:#FFE499;
border-style:none solid solid;
border-width:medium 1px 1px;
float:left;
margin-left:-1px;
position:absolute;
width:188px;
}
function customcode() {
Drupal.editor.editor.on('toolbarLoaded',function() {
var customcodeButton = {type: 'push',label: 'Insert Custom code', value: 'insertcustomcode'};
this.toolbar.addButtonToGroup(customcodeButton,'specialbuttons');
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event,
Lang = YAHOO.lang;
var _handleWindowClose = function() {