Skip to content

Instantly share code, notes, and snippets.

View since1976's full-sized avatar

Daniel Eberhardt since1976

  • Auckland, New Zealand
View GitHub Profile
@since1976
since1976 / alerts.html
Created August 13, 2013 22:07
Different types of alert messages marked up
<div class="alert">
<p>Looks like you have already signed up using that email address. Would you like to <a href="/account">Sign in instead</a>?</p>
</div>
<div class="alert alert--info">
<p><strong>Info:</strong> Looks like you have already signed up using that email address. Would you like to <a href="/account">Sign in instead</a>?</p>
</div>
<div class="alert alert--warning">
<p><strong>Warning:</strong> Looks like you have already signed up using that email address. Would you like to <a href="/account">Sign in instead</a>?</p>
@since1976
since1976 / _layout.scss
Created August 13, 2013 03:54
Generated name from list
$layoutList: mc mcc cc c;
@each $layout in $layoutList{
.layout-#{$layout} .content:before{
content: 'Layout: #{$layout}';
position: absolute;
left: 0;
top: 0;
padding: 6px;
font-size: pem(11);
@since1976
since1976 / batch rename
Last active December 20, 2015 10:39
Terminal command to batch rename files.
// To view what files will change to run
for file in *; do mv echo "$file" "${file/part of the file you want removed/}"; done
// To actually run the command
for file in *; do mv "$file" "${file/part of the file you want removed/}"; done
// This will cut everything before the first dot and appends .mov
for i in *;
do j=`echo $i | cut -d . -f 1`;
j=$j".mov";
@since1976
since1976 / zendesk_support.html
Created October 30, 2012 22:29
Zendesk Support code
<script type="text/javascript" src="//assets.zendesk.com/external/zenbox/v2.5/zenbox.js"></script>
<style type="text/css" media="screen, projection">
@import url(//assets.zendesk.com/external/zenbox/v2.5/zenbox.css);
</style>
<script type="text/javascript">
if (typeof(Zenbox) !== "undefined") {
Zenbox.init({
dropboxID: "20110738",
url: "https://nesi.zendesk.com",
tabID: "Support",
@since1976
since1976 / config.local.php
Created October 11, 2012 20:21
Local Config file for EECMS
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Local config overrides & db credentials
*/
// === DB CONNECTION
$env_db['hostname'] = '';
$env_db['username'] = '';
@since1976
since1976 / gist:1878799
Created February 21, 2012 20:42
Show hide google map
$('a.toggle').click(function() {
event.preventDefault();
$("div.hide").slideToggle("fast");
var $t = $(this);
var href = $t.attr('href');
if(href == '#map') {
google.maps.event.addListener(map_canvas, 'resize', function() {
map_canvas.setCenter(map_bounds.getCenter());
@since1976
since1976 / clueless
Created January 12, 2012 01:16
Stash
{exp:stash:set name="content"}
<section>
<h1 id="committee_members">Main Committee members</h1>
{exp:stash:get name="committee"}
{exp:channel:entries channel="committee_positions" dynamic="no" status="not closed|draft" search:cf_position_type="cm" entry_id="not 47" {global:param_disable_default}}
{snip_committee_position}
{/exp:channel:entries}
{exp:channel:entries channel="committee_positions" dynamic="no" status="not closed|draft" entry_id="47" {global:param_disable_default}}
{snip_committee_position}
@since1976
since1976 / position.scss
Created January 6, 2012 01:31
SCSS each
// Position all items absolute
@each $pos in tl, tr, bl, br {
.pos-#{$pos} {
position:absolute;
}
}
// Now position them
.pos-tl{left:3%; top:3%;}
.pos-tr{right:3%; top:3%;}
.pos-bl{left:3%; bottom:3%;}
@since1976
since1976 / Dropboxuploader.php
Created August 23, 2011 01:46
Custom EE Dropbox upload form
<?php
if ($_POST) {
require CUSTOM_SCRIPTS_FOLDER.'dropboxuploader.php';
try {
// Rename uploaded file to reflect original name
if ($_FILES['file']['error'] !== UPLOAD_ERR_OK)
throw new Exception('File was not successfully uploaded from your computer.');