Skip to content

Instantly share code, notes, and snippets.

View danomanion's full-sized avatar

LaminarRainbow danomanion

View GitHub Profile
@aaronott
aaronott / gist:3278232
Created August 6, 2012 20:40
Make a user login prior to accessing anything on the site.
global $user;
/*
* If the user is not logged in, require them to login prior to being
* redirected to the form
*/
if ($user->uid === 0 && arg(0) != 'user') {
$dest = drupal_get_path_alias($_GET['q']);
drupal_goto('user', array('query' => array('destination' => $dest)));
}
@aaronott
aaronott / d7_fixperms.sh
Created October 17, 2012 20:37
Fix D7 file permissions
#!/bin/sh
PERM_USER=nobody
PERM_GROUP=dev
APACHE_USER=apache
if [ $# -ne 1 ] ; then
echo "USAGE $0 <d7 root dir>"
exit;
fi
@kenwoodworth
kenwoodworth / Design Smarter, Not Harder - Resources & Links.md
Last active December 18, 2015 21:09
A collection of links from my talk, Design Smarter, Not Harder
~/.ideas.md
# Software
- doomed startup idea 1
- some feature for an open-source project
- doomed startup idea 2
- ...
# Blog posts
- the .ideas file
#!/bin/sh
SOURCEDIR=/path/to/docroot
DESTDIR=/path/to/backup/dir
NAME=<site-name>
RETENTION=2
let MMIN=($RETENTION*60*24)-180
DATE=`date +%Y-%m-%d-%H-%M`
EXCLUDE=""
#!/bin/sh
DBNAME=<database>
DBUSER=<dbuser>
DBPASS=<good-strong-password?>
DBHOST=localhost
DESTDIR=/path/to/backup/dir
NAME=<site-name>
RETENTION=2
let MMIN=($RETENTION*60*24)-30
@mparker17
mparker17 / 7-docker-compose.yml
Last active May 8, 2017 14:08
Docker-compose templates for D7, D8
#
# Minimal Drupal 7.x development environment.
#
# Use:
# 1. Place a copy of this file at your Drupal site root.
# 2. Start the web stack: `USER_ID=$(id -u) docker-compose up -d`
# 3. Set up `settings.local.php` (note that the host is 'db' and the username,
# password, and schema are in the environment variables for the database
# container below).
# 4. If you have a database dump to import, place it in your Drupal site root,
@aaronott
aaronott / index.txt
Created May 4, 2018 13:22
blackhole_links
<?php
$max_num_links = 7;
$page = "/";
if (isset($_SERVER['REQUEST_URI'])) {
$page = htmlentities(rtrim($_SERVER['REQUEST_URI'], "/"));
}
?>
<h1>Hidden links</h1>
<h2><?php echo $page; ?></h2>
@danomanion
danomanion / index.html
Created March 7, 2019 15:33
List - JS / HTML
<div id="container">
</div>
@danomanion
danomanion / index.html
Last active March 7, 2019 15:35
Vue.js
<div id="app">
<ul>
<li v-for="item in items">
{{ item }}
</li>
</ul>
</div>