Skip to content

Instantly share code, notes, and snippets.

View malaren-latlong.kml
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd">
<Document xmlns:atom="http://purl.org/atom/ns#">
<name>grundvatten:SE.GOV.SGU.BRUNNAR.250K</name>
<Placemark id="SE.GOV.SGU.BRUNNAR.250K.fid--1d29464a_1382ef57918_344c">
<name><![CDATA[SE.GOV.SGU.BRUNNAR.250K.fid--1d29464a_1382ef57918_344c]]></name>
<description><![CDATA[<h4>SE.GOV.SGU.BRUNNAR.250K</h4>
<ul class="textattributes">
<li><strong><span class="atr-name">Brunns-ID</span>:</strong> <span class="atr-value">106400441</span></li>
View gist:99ff0307181967107e26
{
"title": "Civilingenjör i datorsäkerhet",
"sections": {
"overview": {
"title": "Översikt",
"subSections": {
"profile": {
"header": "Profil - innehåll",
"content": "<p>Den här utbildningen ger dig en stabil grund inom datakunskap och en unik spetskompetens inom datorsäkerhet så att du kan förebygga, upptäcka och åtgärda såväl tekniska problem som kriminalitet.</p><p>Kanske kommer du att arbeta på Statens kriminaltekniska laboratorium med att analysera IT-bevismaterial, på Ericsson med utveckling av programvara eller vid Säkerhetspolisen. Du kan jobba som säkerhetschef eller säkerhetskonsult i Sverige eller utomlands.</p><p>Programmet ger dig grunderna du behöver i datorsystemteknik, programmering och matematik. På kurserna i datorsäkerhet söker du digitala bevis med forensisk datoranalys, studerar nätverkssäkerhet, knäcker lösenord och lär dig hitta spår av intrångsförsök. Projektarbete på företag och gästföreläsningar ger dig nya perspektiv och inspirerar till
View prepare.sh
#!/usr/bin/env bash
chmod_files()
{
for file in "$1"/*; do
[[ ! -d $file ]] && chmod +x "$file"
done
}
@perifer
perifer / gist:fde4f6827e4e9417a9c9
Last active Aug 29, 2015
Asynchronous Javascript Action
View gist:fde4f6827e4e9417a9c9
// Adopted from
// http://www.obdev.at/resources/launchbar/developer-documentation/javascript-http.html#//apple_ref/cpp/Method/getJSON
function run(done) {
var search = 'perfect circle';
var query = encodeURIComponent(search);
var result = HTTP.getJSON('http://ws.spotify.com/search/1/artist.json?q=' + query, function(result) {
if (result.data != undefined) {
// Show the top result:
var artist = result.data.artists[0];
done([{ 'title' : artist.name}]);
@perifer
perifer / bitbucket-origin-all.sh
Created Oct 22, 2013
Change the origin remote url from github to bitbucket for all git repos inside the current folder and 3 levels down
View bitbucket-origin-all.sh
# Change the origin remote url from github to bitbucket
# for all git repos inside the current folder and 3 levels down
CURRENT=`pwd`
for DIR in $(find . -name ".git" -type d -maxdepth 3)
do
cd "$DIR"
cd ..
OLDORIGIN=`git config --get remote.origin.url`
View gist:5488903

go keys

security feautures

Each client holds a secret. The secret is used as passphrase for the keys (or only one key?) on the master.

The secret is also used to create a hmac that validates that the data stored in db.json has not been tampered with. This is done by created an hmac of the data in db.json and the secret. The hmac is saved in db.json alongside with the data. Next requset to the server from a client the hmac is recreated and matched against the stored hmac to verify that the data is not changed.

View gist:5195119

go keys

go keys server

go keys server add NAME --user SERVER_USER --hostname HOSTNAME --url SERVER_URL --tags "TAG1,TAG2,TAG3" --repo REPO_URL --description "A DESCRIPTION" (other options)

--tags: coma or space seperated

go keys server edit (same options as add)

@perifer
perifer / track.js
Created Mar 2, 2013
Track virtual page views in Google Analytics if (window._gaq) { window._gaq.push(['_trackPageview', window.location.pathname + href]); }
View track.js
if (window._gaq) {
window._gaq.push(['_trackPageview', href]);
}
@perifer
perifer / gist:3952349
Created Oct 25, 2012
Improved web font loader code to prevent FOUT
View gist:3952349
// Custom web font loader inspired by the TypeKit loader.
WebFontConfig = {
fontdeck: {
id: FONTDECK_ID
},
active: function() {
clearTimeout(this._timeout);
}
};
(function() {
@perifer
perifer / ckedit.make
Created Jul 9, 2012
Drupal make file for ckeditor/wysiwyg
View ckedit.make
; Wysiwyg make file. Specify core version below.
; Place in Drupal root and run from the drupal
; root directory with
; drush make ckedit.make --no-core .
core = 6.x
;core = 7.x
api = 2