Skip to content

Instantly share code, notes, and snippets.

@pe3
pe3 / index.html
Created February 1, 2014 17:20
Recycle SVG elements with defs
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Diagram</title>
</head>
<body>
<div>
<svg width="200" height="100">
<defs>
@pe3
pe3 / freeze_tabs.sh
Created September 16, 2013 06:14
Take back your computing resources from Chrome tabs
#!/bin/bash
for i in $(
ps x |
grep 'Google Chrome Helper' |
grep -v grep |
cut -d ' ' -f 1
); do
kill $i;
done
@pe3
pe3 / inline_and_block-level_flow.html
Created July 28, 2013 16:35
Normal Document Flow
<!doctype html>
<html lang="en">
<head>
<title>Normal Document Flow</title>
<style type="text/css">
p, span {
background: #999;
@pe3
pe3 / list_file_system_links.md
Last active December 20, 2015 05:19
Working with file system links
@pe3
pe3 / list_directory_in_github_repo.html
Last active December 20, 2015 01:49
Listing directory in GitHub repo.
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<!--
Get contents on GitHub API documentation http://developer.github.com/v3/repos/contents/#get-contents
-->
<div id="result"></div>
@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')
@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.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 / scrape_entire_website_with_wget.sh
Last active March 9, 2024 17:42
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 / style.css
Created July 10, 2013 09:46
Show all CSS borders
* {
border: 1px dashed #0000ff;
}