Skip to content

Instantly share code, notes, and snippets.

@Knight1
Knight1 / packet.net
Last active May 3, 2018 04:31
Check Packet.net availability of specific server type in every location and ~💵 not collected per month
#!/bin/bash
#Usage: default is Type 2a. If you wish another server type use ./packet.net 1/2/3
#See https://www.packet.net/bare-metal/
#Obtain api key here => https://app.packet.net/portal#/api-keys
KEY=
if [[ -z ${1+x} ]]; then
PLAN=2a
else
@yhahn
yhahn / marker.png
Last active August 29, 2015 14:07
mapnik markersnapping testcase
marker.png
@kkaefer
kkaefer / faster-sublimeclang.sh
Created June 16, 2014 08:40
Faster SublimeClang by using Xcode's libclang.dylib
#!/usr/bin/env bash
# Credits go to Dennis Luxen (https://twitter.com/DennisLuxen)
pushd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/SublimeClang/internals/
cp /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib .
cd ../src/build
make
popd
@trevnorris
trevnorris / perf-flame-graph-notes.md
Last active December 24, 2023 05:25
Quick steps of how to create a flame graph using perf

The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.

When you want to generate the flame graph, run the following (folder locations taken from install script):

sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
@tmcw
tmcw / -
Created March 14, 2014 22:04
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.history
setopt autopushd pushdsilent
fpath=(/usr/local/share/zsh-completions $fpath)
autoload -U colors && colors
autoload -U compinit promptinit
@tmcw
tmcw / editors.md
Last active August 29, 2015 13:57

Context: a class of 10 9th-12th graders doing a week-long class on HTML, CSS, and JavaScript.

The question of an editor. While we stay in guided environments like jsbin & mistakes.io for the first two days of class, in order to save to files and tinker, we eventually need to ‘save to disk’ to view things as real websites and understand how code works.

I use vim personally, but know very well that it’s a tough place to start for students, and would be a dangerous distraction from the topics.

What really matters for an editor in this setting:

  1. It should be simple to use. This means keystrokes do what they do in other programs, like Word.
  2. It should not crash.
@tibordp
tibordp / variant.cc
Last active November 14, 2023 16:04
A simple variant type implementation in C++
#include <iostream>
#include <utility>
#include <typeinfo>
#include <type_traits>
#include <string>
template <size_t arg1, size_t ... others>
struct static_max;
template <size_t arg>
1. Install Anaconda to get your python 2.7.
2. Install .Net Framework - dotNetFx45_Full_setup.exe
3. Uninstall the Microsoft Visual C++ 2010 instances.
4. Install the Microsoft SDK - winsdk_web.exe #http://www.microsoft.com/en-us/download/details.aspx?id=8279
5. Install Node.js - http://nodejs.org/download/
6. Open your command prompt as an administrator
>Start
>"cmd" in Search for All Programs
>Ctrl-RightClick on CMD and "Run as Administrator"
7. Set your environment for the SDK (this was tricky to figure out!)
@pnorman
pnorman / install.md
Last active September 15, 2019 15:26
Draft install instructions for osm2pgsql + carto + renderd

Manually building a tile server

This page describes how to install, setup and configure all the necessary software to operate your own tile server. The step-by-step instructions are written for Ubuntu Linux 12.04 LTS (Precise Pangolin), however they should transfer fairly straightforwardly to other versions of Ubuntu or Linux distributions.

##Software installation The OSM tile server stack is a collection of programs and libraries that work together to create a tile server. As so often with OpenStreetMap, there are many ways to achieve this goal and nearly all of the components have alternatives that have various specific advantages and disadvantages. This tutorial describes the most standard version that is also used on the main OpenStreetMap.org tile server.

This guide covers installation of osm2pgsql, loading a PostgreSQL/PostGIS database, and rendering tiles for an online webmap.The database can also be used to [develop stylesheets], or render data with other software.

Before starting you want t

@zeke
zeke / tumblr_to_jekyll.sh
Last active December 17, 2015 12:59
A brutish migration script from Tumblr posts to Jekyll-friendly markdown files.
# Change this to your blog URL...
export TUMBLR_URL="http://zeke.tumblr.com"
# As of this writing, jekyll and jekyll-import are busted. :(
gem uninstall jekyll -aIx
# Install an old version of jekyll that includes a migration script
gem install jekyll -v 0.11.2
# Install a python package that converts HTML to Markdown