git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
More detailed version: https://til.simonwillison.net/git/git-archive
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
import threading | |
# Based on tornado.ioloop.IOLoop.instance() approach. | |
# See https://github.com/facebook/tornado | |
class SingletonMixin(object): | |
__singleton_lock = threading.Lock() | |
__singleton_instance = None | |
@classmethod |
using UnityEngine; | |
using System.Collections; | |
public class TouchCamera : MonoBehaviour { | |
public Transform target; | |
Vector3 f0Dir= Vector3.zero; | |
float zoomDistance= 5; | |
float theta= 0.0F; | |
float fai= 0.0F; | |
float dx= 0.0F; |
#!/usr/bin/env python3 | |
# Quick and dirty implementation of mounting a local volume using Gio. | |
# For people who were scratching their heads like me. | |
# Code below based on infos from: | |
# http://stackoverflow.com/questions/5709454/gio-check-if-volume-is-mounted | |
# http://stackoverflow.com/questions/1991206/accessing-samba-shares-with-gio-in-python/2051628#2051628 | |
# -*- coding: utf-8 -*- | |
""" | |
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store. | |
Referred from http://chrome-extension-downloader.com/how-does-it-work.php | |
""" | |
from __future__ import division | |
import argparse | |
import requests |
#!/bin/bash | |
# Run once to patch `rcd` daemon after creating a backup. | |
# Run again to restore the backup and revert back to original functionality. | |
set -eu | |
if [ "$USER" != "root" ]; then | |
exec sudo "$0" "$@" | |
fi | |
rcd="/System/Library/CoreServices/rcd.app/Contents/MacOS/rcd" |
git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
More detailed version: https://til.simonwillison.net/git/git-archive
.force-show-scrollbars ::-webkit-scrollbar-track:vertical { | |
border-left: 1px solid #E7E7E7; | |
box-shadow: 1px 0 1px 0 #F6F6F6 inset, -1px 0 1px 0 #F6F6F6 inset; | |
} | |
.force-show-scrollbars ::-webkit-scrollbar-track:horizontal { | |
border-top: 1px solid #E7E7E7; | |
box-shadow: 0 1px 1px 0 #F6F6F6 inset, 0 -1px 1px 0 #F6F6F6 inset; | |
} |
<!-- | |
Basic syntax highlight for Unity ShaderLab code in Project Rider. | |
v1.0 | |
Download this file and put it into your "filetypes" folder. | |
Windows Vista, 7, 8, 10: | |
<SYSTEM DRIVE>\Users\<USER ACCOUNT NAME>\.Rider10\config\filetypes | |
Mac OS X: |