An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
#! /usr/bin/env python | |
""" Convert values between RGB hex codes and xterm-256 color codes. | |
Nice long listing of all 256 colors and their codes. Useful for | |
developing console color themes, or even script output schemes. | |
Resources: | |
* http://en.wikipedia.org/wiki/8-bit_color | |
* http://en.wikipedia.org/wiki/ANSI_escape_code |
import yaml | |
import yaml.constructor | |
try: | |
# included in standard lib from Python 2.7 | |
from collections import OrderedDict | |
except ImportError: | |
# try importing the backported drop-in replacement | |
# it's available on PyPI | |
from ordereddict import OrderedDict |
#!/bin/sh | |
export PYTHONPATH=$HOME/usr/opt/pyyaml/lib/python2.6/site-packages | |
python -c ' | |
import sys, json, yaml | |
with open(sys.argv[1]) as f: | |
print yaml.safe_dump(json.load(f), default_flow_style=False) | |
' $@ |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Source mapping is a technique that "maps" your browser inspector's line numbers to the source file. This is useful when working with assets that are compiled from LESS, SASS, Coffeescript and so on. Source maps can also be used with minified assets that would normally have their line numbers removed. If you're curious, here's some more information regarding source maps.
The default behavior of Gradle to pick the newest version also applies if a lower version has been declared locally, but another dependency transitively pulls in a newer version. This is in contrast with Maven, where a locally declared version will always win.
For example, if your build.gradle
specifies the dependency org.springframework:spring-tx:3.2.3.RELEASE
, and another dependency declares 4.0.5.RELEASE
as a transitive dependency, then 4.0.5.RELEASE
will take precedence:
dependencies {
compile("org.springframework.data:spring-data-hadoop:2.0.0.RELEASE")
compile("org.springframework:spring-tx:3.2.3.RELEASE")
// will select org.springframework:spring-tx:4.0.5.RELEASE
# Ruby is our language as asciidoctor is a ruby gem. | |
lang: ruby | |
before_install: | |
- sudo apt-get install pandoc | |
- gem install asciidoctor | |
script: | |
- make | |
after_success: | |
- .travis/push.sh | |
env: |
import subprocess | |
import time | |
def wait(seconds): | |
time.sleep(seconds) | |
def play_note(note='C', duration=4, delay=0): | |
# requires sox to be installed |
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons: