Skip to content

Instantly share code, notes, and snippets.

View martisj's full-sized avatar
🐊

Martin Sjåstad martisj

🐊
View GitHub Profile
@martisj
martisj / root_htaccess
Created November 25, 2012 22:31
root htaccess
# AddHandler php-legacy .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@martisj
martisj / dabblet.css
Created December 11, 2012 12:45
The first commented line is your dabblet’s background: #f06;#borders {
/**
* The first commented line is your dabblet’s background: #f06;#borders {
}
#borders
{
position: relative;
border: 5px solid #f00;
}
@martisj
martisj / memcacheerr
Created December 14, 2012 06:28
memcache error
<b>Warning</b>: PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/memcached.so' - dlopen(/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/memcached.so, 9): Library not loaded: /usr/local/lib/libmemcached.10.dylib
Referenced from: /Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/memcached.so
Reason: image not found in <b>Unknown</b> on line <b>0</b><br />
<br />
@martisj
martisj / dabblet.css
Created December 17, 2012 05:06
Icons getting cut off
/* Icons getting cut off*/
span.event-type
{
color: #6c6c6c;
}
.event_heading{
color: #ffffff;
background-color: #464646;
margin: 15px -26px 0 -24px;
@martisj
martisj / if_elseif_fail.php
Created January 18, 2013 02:39
class to 3rd and higher than 7th elem
$class = '';
if (($i + 1) % 3 == 0)
{
$class .= 'nth-child-3n';
}
elseif (($i + 1) > 6)
{
$class .= ' nth-child-nplus7';
}
@martisj
martisj / htaccess
Last active December 11, 2015 15:28
doesnt rewrite to correct url
# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php
RewriteEngine On
#For martinsjastad.com and frontsideinteractive.com
# automatically redirect user from www.martinsjastad.com to martinsjastad.com
# automatically redirect user from www.frontsideinteractive.com to frontsideinteractive.com
RewriteCond %{HTTP_HOST} =www.martinsjastad.com [NC]
RewriteRule (.*) http://martinsjastad.com/$1 [R=301,L]
@martisj
martisj / home.php
Created January 30, 2013 02:00
home loop
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
<article class="vcard">
<a href="mailto:[email protected]" class="email">[email protected]</a>
På telefon etter klokken 16:00 på hverdager:
<div class="vcard">
<span class="fn">Dag</span>:<span class="tel">+47 92 89 89 81</span>
</div>
<div class="vcard">
<span class="fn">Jan</span>:<span class="tel">+47 91 85 85 95</span>
</div>
</article>
@martisj
martisj / colors.fish
Created February 19, 2013 23:24
shellgist
if $COLORTERM gnome-* and $TERM = xterm and infocmp gnome-256color >/dev/null 2>&1
set -x TERM=gnome-256color
else if infocmp xterm-256color >/dev/null 2>&1
set -x TERM=xterm-256color
end
if [[tput setaf 1]] &> /dev/null
tput sgr0
if [[ tput colors -ge 256 ]] 2>/dev/null
set -x MAGENTA (tput setaf 9)
@martisj
martisj / jskatta.js
Created February 25, 2013 17:40
jskatta
var $element_store;
$camp_photos.on('click', '.top_level_image_link', function() {
var $this = $(this);
var $photo_albums = $('#photo_albums');
$element_store = $photo_albums;
var $photo_album_to_load = $('#photo_album-' + $this.data('album-id'));
// replace_content_and_make_slides(new_html, container);
$camp_photos.animate({opacity: 0}, 'fast', function() {