Skip to content

Instantly share code, notes, and snippets.

@Knight1
Knight1 / packet.net
Last active May 3, 2018
Check Packet.net availability of specific server type in every location and ~💵 not collected per month
View packet.net
#!/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 Aug 29, 2015
mapnik markersnapping testcase
@kkaefer
kkaefer / faster-sublimeclang.sh
Created Jun 16, 2014
Faster SublimeClang by using Xcode's libclang.dylib
View faster-sublimeclang.sh
#!/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 Jul 21, 2021
Quick steps of how to create a flame graph using perf
View perf-flame-graph-notes.md

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
View -
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.history
setopt autopushd pushdsilent
fpath=(/usr/local/share/zsh-completions $fpath)
autoload -U colors && colors
autoload -U compinit promptinit
View editors.md

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 Dec 30, 2022
A simple variant type implementation in C++
View variant.cc
#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>
View Topojson install
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 Sep 15, 2019
Draft install instructions for osm2pgsql + carto + renderd
View install.md

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 Dec 17, 2015
A brutish migration script from Tumblr posts to Jekyll-friendly markdown files.
View tumblr_to_jekyll.sh
# 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