Skip to content

Instantly share code, notes, and snippets.

<item>
<title>Brinna</title>
<link>http://www.scouterna.se/aktiviteter-och-lager/scoutklader-och-marken/intressemarken/brinna/</link>
<pubDate>Wed, 21 Nov 2012 22:03:40 +0000</pubDate>
<dc:creator>pontus.lof</dc:creator>
<guid isPermaLink="false">http://scouterna.spacedout.se/?post_type=marke-intresse&#038;p=15177</guid>
<description></description>
<content:encoded><![CDATA[<p class="content-preamble">Det här är en fortsättning på intressemärket Tända. Genom att jobba med Brinna lär du dig mer om elden och hur man kan använda den på ett bra sätt. Eld som kan användas till att laga mat på, skapa en mysig stämning eller ge värme.</p>
<h2>Innehåll</h2>
.-"--"""".__ `.
| ` |
( `._....------.._.:
. ) ( <o> <o> g)
) ) / J
( |. / . (
$$ (. (_'. , )|`
|| |\`-....--'/ ' \
/||. \\ | | | / / \.
//||(\ \`-===-' ' \o.
@bolstad
bolstad / gist:5422277
Created April 19, 2013 18:35
Begränsa strängen till max antal chars men behåll hela ord
<?php
function cutstr($str, $length, $ellipsis='')
{
$cut=explode('\n\n',wordwrap($str),$length,'\n\n'));
return $cut[0].((strlen($cut)<strlen($str))?$ellipsis:'');
}
echo cutstr('hej hej, nu ska vi kolla på hur det blir här. kommer det här att bli bra? eller vad säger du ? ', 30,'...');
@bolstad
bolstad / gist:5422344
Created April 19, 2013 18:45
# Origin pull in nginx
# Origin pull in nginx
upstream origin {
server host.domain.tld:80;
}
server {
listen 80;
root /var/www;
index index.html index.htm;
<?php
/**
* @package Cache Wrapper
* @version 1.0
*/
/*
Plugin Name: Cache Wrapper
Version: 1.0
*/
kers@blingamatic:~/scripts/sigtuna_cache_invalidate/AWS-CloudFront-Invalidator-master$ php invalidate.php E219B1SVKAUH77 /ds-eventcalendar-external
Making invalidation request...
Request completed successfully:
ID: I14HNEDA0HUK6P
Time: 2013-07-08T08:08:23.407Z
Status: InProgress
Getting status of the last invalidation requests...
I14HNEDA0HUK6P: InProgress
I2B7Z4QBGM9389: Completed
[Dialer Defaults]
Init1 = ATH
Init2 = ATE1
Init3 = AT+CGDCONT=1,"IP","online.telia.se","",0,0
Dial Command = ATD
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
@bolstad
bolstad / 0_reuse_code.js
Created September 28, 2013 06:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bolstad
bolstad / gist:7361747
Created November 7, 2013 20:57
redis benchmark on raspberry pi
christian@raspbx:~$ redis-benchmark -q -n 100000
PING_INLINE: 2937.46 requests per second
PING_BULK: 2794.08 requests per second
SET: 2584.38 requests per second
GET: 2654.63 requests per second
INCR: 2532.42 requests per second
LPUSH: 2598.96 requests per second
LPOP: 2597.88 requests per second
SADD: 2635.74 requests per second
SPOP: 2800.02 requests per second
@bolstad
bolstad / gist:7578888
Created November 21, 2013 09:53
strict error reporting for PHP
error_reporting( E_ALL );
ini_set( 'display_errors', 'On' );
ini_set( 'display_startup_errors', 'On' );
// error report routine based on code by pekka @ stackowerflow http://stackoverflow.com/a/3193084
error_reporting( -1 );
function terminate_missing_variables( $errno, $errstr, $errfile, $errline ) {
if ( ( $errno == E_NOTICE ) and ( strstr( $errstr, "Undefined variable" ) || strstr( $errstr, "Undefined property" ) || strstr( $errstr, "Undefined index" ) ) )
die ( "\nFATAL: $errstr in $errfile line $errline \n" );