Skip to content

Instantly share code, notes, and snippets.

@pe3
pe3 / index.html
Last active December 19, 2015 06:29
Show OpenStreetMap with Leaflet
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Test</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
<style type="text/css">
@pe3
pe3 / Gruntfile.coffee
Created July 8, 2013 11:07
Compile Jade to HTML with minimal Grunt
module.exports = (grunt) ->
grunt.initConfig
jade:
compile:
options:
pretty: true
data: { pageTitle: 'Otsikko otsikko', youAreUsingJade: '1' }
files: [
src: './example.jade'
dest: './example.html'
@pe3
pe3 / Gruntfile.coffee
Created July 8, 2013 11:58
Compile YAML to JSON with minimal Grunt
module.exports = (grunt) ->
grunt.initConfig
yaml:
render: #miksi tähän voi taas laittaa mitä vaan?
files: [
src: './example.yaml'
dest: './example.json'
]
grunt.loadNpmTasks 'grunt-yaml'
@pe3
pe3 / Gruntfile.coffee
Last active December 19, 2015 11:29
Downloading a HTML file with minimal Grunt
module.exports = (grunt) ->
grunt.initConfig
curl:
long:
src: 'http://www.hankintailmoitukset.fi/fi/?all=1'
dest: './scrape-file.html'
grunt.loadNpmTasks 'grunt-curl'
grunt.registerTask 'default', 'This is the default task', 'curl'
@pe3
pe3 / Gruntfile.coffee
Last active December 19, 2015 11:38
Compile Handlebars to HTML with minimal Grunt
module.exports = (grunt) ->
grunt.initConfig
staticHandlebars:
options:
partials: ""
helpers: ""
simpleTarget:
# Target-specific file lists and/or options go here.
@pe3
pe3 / style.css
Created July 10, 2013 09:46
Show all CSS borders
* {
border: 1px dashed #0000ff;
}
@pe3
pe3 / scrape_entire_website_with_wget.sh
Last active September 10, 2024 08:54
Scrape An Entire Website with wget
this worked very nice for a single page site
```
wget \
--recursive \
--page-requisites \
--convert-links \
[website]
```
wget options
@pe3
pe3 / hello.cpp
Created July 14, 2013 22:00
Compiling C++ Hello world on OSX
/* compile with: g++ hello.cpp -o hello */
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!\n";
return 0;
}
@pe3
pe3 / hello.js
Created July 17, 2013 12:53
Say hello to Objective-C on OSX through Node
var $ = require('NodObjC')
// First you import the "Foundation" framework
$.framework('Foundation')
// Setup the recommended NSAutoreleasePool instance
var pool = $.NSAutoreleasePool('alloc')('init')
// NSStrings and JavaScript Strings are distinct objects, you must create an
// NSString from a JS String when an Objective-C class method requires one.
@pe3
pe3 / hello-cocoa.js
Created July 17, 2013 12:55
Say hello to Cocoa on OSX from Node
var $ = require('NodObjC')
$.import('Cocoa')
var pool = $.NSAutoreleasePool('alloc')('init')
, app = $.NSApplication('sharedApplication')
app('setActivationPolicy', $.NSApplicationActivationPolicyRegular)
var menuBar = $.NSMenu('alloc')('init')