Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
| # Example makefile with some dummy rules | |
| .PHONY: all | |
| ## Make ALL the things; this includes: building the target, testing it, and | |
| ## deploying to server. | |
| all: test deploy | |
| .PHONY: build | |
| # No documentation; target will be omitted from help display | |
| build: |
| class Hst | |
| attr_reader :version | |
| attr_reader :copyright | |
| attr_reader :symbol | |
| attr_reader :period | |
| attr_reader :digits | |
| attr_reader :timesign | |
| attr_reader :lastsync | |
| def initialize(file) |
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| #!/usr/bin/env ruby | |
| =begin | |
| = Geographic Searches With Postgres's Earthdistance and Cube Extensions | |
| This program shows how to easily create a Postgres database that uses the Cube | |
| and Earthdistance extensions to perform fast queries on geographic data. | |
| Briefly, the problem this code solves is "show me all places within 50 | |
| kilometers of New York City." |
| package main | |
| import ( | |
| "bytes" | |
| "encoding/hex" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "log" | |
| "net" |
| # Example usage: | |
| # with temporary_settings(CELERY_ALWAYS_EAGER=True): | |
| # run_task.delay() # runs task with eager setting enabled. | |
| from contextlib import contextmanager | |
| from django.conf import settings | |
| @contextmanager | |
| def temporary_settings(**temp_settings): | |
| orig_settings = {} |