Skip to content

Instantly share code, notes, and snippets.

View blackhalt's full-sized avatar
🎯
Focusing

BlackHalt blackhalt

🎯
Focusing
View GitHub Profile
@blackhalt
blackhalt / Padara saites spiežamas.js
Created July 19, 2012 07:50
Linkify Bookmarklets vienkāršas teksta saites Padara spiežamas
javascript:(function(){var%20D=document;%20D.body.normalize();%20F(D.body);%20function%20F(n){var%20u,A,M,R,c,x;%20if(n.nodeType==3){%20u=n.data.search(/https?\:\/\/[^\s]*[^.,;'%22>\s\)\]]/);%20if(u>=0)%20{%20M=n.splitText(u);%20R=M.splitText(RegExp.lastMatch.length);%20A=document.createElement(%22A%22);%20A.href=M.data;%20A.appendChild(M);%20R.parentNode.insertBefore(A,R);%20}%20}else%20if(n.tagName!=%22STYLE%22%20&&%20n.tagName!=%22SCRIPT%22%20&&%20n.tagName!=%22A%22)for(c=0;x=n.childNodes[c];++c)F(x);%20}%20})();
@blackhalt
blackhalt / gist:3141244
Created July 19, 2012 07:06
Žurnālisti
<!--
BlackHalt bh.id.lv
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Žurnālisti</title>
@blackhalt
blackhalt / temperatuura.php
Created July 8, 2012 11:59
Faktiskā temperatūra
<?php
$json = file_get_contents('http://www.meteo.lv/meteorologijas-operativie-dati/');
$obj = json_decode($json);
$graadi = $obj->stations[5]->parameters[0]->{'value'};
echo $graadi;