An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Hi:
perl -e 'print "hello world!\n"'
A simple filter:
perl -ne 'print if /REGEX/'
Filter out blank lines (in place):
import string | |
import sys | |
import logging | |
import json | |
from flask import Flask | |
from flask import Response, request | |
logger = logging.getLogger(__name__) | |
logger.info("Stackdriver webhook-sample starting up on %s" % (string.replace(sys.version, '\n', ' '))) |
Statix is a stand-alone Bash script aimed at generating full-featured, routable static websites from reusable HTML snippets. It features the most basic templating engine ever possible but allows to organize your content in a SEO-friendly way. All Statix-based websites contain these parts:
This script is also lightweight. Aside from some standard file management commands such as cp
, mkdir
and rm
, the only serious dependency for Statix is GNU Grep compiled with PCRE support (i.e. the version that supports -P
flag, included in most Linux distributions).
# 10_basic.py | |
# 15_make_soup.py | |
# 20_search.py | |
# 25_navigation.py | |
# 30_edit.py | |
# 40_encoding.py | |
# 50_parse_only_part.py |
Preconditions:
- POSIX or Windows system
- Install Docker
- A GitHub repo that already builds on Travis
Postcondition:
from lxml import html, etree | |
import datetime | |
import requests | |
import re | |
import os | |
import sys | |
import unicodecsv as csv | |
import argparse | |
import json | |
# from exceptions import ValueError |
#!/usr/bin/env bash | |
set -eo pipefail | |
# from moby project - w/o go dependency (nailing amd64) and w/o jq dep (using | |
# python) | |
# hello-world latest ef872312fe1b 3 months ago 910 B | |
# hello-world latest ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9 3 months ago 910 B | |
# debian latest f6fab3b798be 10 weeks ago 85.1 MB | |
# debian latest f6fab3b798be3174f45aa1eb731f8182705555f89c9026d8c1ef230cbf8301dd 10 weeks ago 85.1 MB |