A very brief guide to Rust syntax. It assumes you are already familiar with programming concepts.
This was written in 2014. It is not a good reference for Rust today, though the content is still correct.
cheats.rs looks like a good alternative.
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html | |
# First of all you need to have a clean clone of the source repository so we didn't screw the things up. | |
git clone git://server.com/my-repo1.git | |
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command | |
git filter-branch --subdirectory-filter your_dir -- -- all | |
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command. |
DECLARE | |
r record; | |
BEGIN | |
FOR r IN SELECT (each(hstore(NEW))).* | |
LOOP | |
RAISE NOTICE '% value is %', r.key, quote_nullable(r.value); | |
END LOOP; | |
RETURN NEW; | |
END |
#!/bin/sh | |
# ANSI Color -- use these variables to easily have different color | |
# and format output. Make sure to output the reset sequence after | |
# colors (f = foreground, b = background), and use the 'off' | |
# feature for anything you turn on. | |
initializeANSI() | |
{ | |
esc="" |
git fetch --all | |
git reset --hard origin/master | |
git pull origin master |
A very brief guide to Rust syntax. It assumes you are already familiar with programming concepts.
This was written in 2014. It is not a good reference for Rust today, though the content is still correct.
cheats.rs looks like a good alternative.
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
function findagent { | |
if ssh-add -l; then | |
echo "Your SSH Agent is already working." | |
return 0 | |
fi | |
for sock in `ls /tmp/ssh-*/agent.*`; do | |
export SSH_AUTH_SOCK=$sock | |
if ssh-add -l; then | |
echo "Your SSH Agent is fixed. New socket=$sock." | |
return 0 |
# copied from http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/ | |
git clone <git repository A url> # clone source repository | |
cd <git repository A directory> | |
git remote rm origin # to make sure it doesn't affect the original repository | |
git filter-branch --subdirectory-filter <directory 1> -- --all # remove all files other than the ones needed | |
mkdir <directory 1> # move them into another directory where they will be stored in the destination repository (if needed) | |
mv * <directory 1> | |
git add . | |
git commit |
const templates = Object.create(null, { | |
load: { | |
value: async function(fileName) { | |
const url = new URL(fileName, | |
document.currentScript && document.currentScript.src || location.href) | |
if (url in this) return this[url] | |
// fetch and parse template as string | |
let template = await fetch(url) | |
template = await template.text() | |
template = new DOMParser().parseFromString(template, 'text/html') |