The goal of this document is to describe the desired user experience for the next generation of "sig" and it's predecessor "git-signatures"
These were useful prototypes but significant improvement is needed before widespread use.
The goal of this document is to describe the desired user experience for the next generation of "sig" and it's predecessor "git-signatures"
These were useful prototypes but significant improvement is needed before widespread use.
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"os" | |
"sort" | |
"strconv" | |
"strings" |
This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.
I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/
in my Dockerfiles, and also work from
isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/
.
At the end of the day, vendoring (and committing vendor/
) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:
// Our simple allocator; O(1) for allocations, just creates new banks when needed, deleting the allocator instance releases all memory | |
struct simple_allocator | |
: public Noncopyable | |
{ | |
enum class BackingStore : uint8_t | |
{ | |
MMAP = 1 | |
}; |
# Cache 10GB for 1 Month | |
proxy_cache_path /var/cache/nginx keys_zone=GS:10m inactive=720h max_size=10240m; | |
upstream gs { | |
server 'storage.googleapis.com:80'; | |
keepalive 100; | |
} | |
server { | |
set $my_domain "yourdomain.com"; |
I've heard this before:
What I really get frustrated by is that I cannot wrap
console.*
and preserve line numbers
We enabled this in Chrome DevTools via blackboxing a bit ago.
If you blackbox the script file the contains the console log wrapper, the script location shown in the console will be corrected to the original source file and line number. Click, and the full source is looking longingly into your eyes.
#!/usr/bin/env PYTHONIOENCODING=utf-8 python | |
# encoding: utf-8 | |
"""Git pre-commit hook which lints Python, JavaScript, SASS and CSS""" | |
from __future__ import absolute_import, print_function, unicode_literals | |
import os | |
import subprocess | |
import sys |
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
-module(merge_sort). | |
-export([merge_sort/1]). | |
% bottom-up merge sort | |
merge_sort([]) -> | |
[]; | |
merge_sort(L) -> | |
iterate([[X] || X <- L]). | |
iterate([Xs]) -> |