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
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
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
async function something() { | |
console.log("this might take some time...."); | |
await delay(5000); | |
console.log("done!") | |
} | |
something(); |
copy($(".checklist-item:not(.checklist-item-checked)").map(function() { | |
var e = $(this), | |
item = e.find(".checklist-item-details-text").text() | |
if (e.hasClass("checklist-item-state-complete")) { | |
item = item + " (DONE)" | |
} | |
return item | |
}).get().join("\n")) |
REGEX remove blank lines:
FROM: http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/remove_blank_lines.html
FIND:
^(?:[\t ]*(?:\r?\n|\r))+
This is a quick tutorial explaining how to get a static website hosted on Heroku.
Why do this?
Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.
// Disable javascript execution from console | |
// http://kspace.in/blog/2013/02/22/disable-javascript-execution-from-console/ | |
var _z = console; | |
Object.defineProperty( window, "console", { | |
get : function(){ | |
if( _z._commandLineAPI ){ | |
throw "Sorry, Can't exceute scripts!"; | |
} | |
return _z; | |
}, |
var doQuery = function() { | |
count.exec(function(err, total) { | |
if (err) return sendError('database error', err); | |
query.exec(function(err, items) { | |
if (err) return sendError('database error', err); | |
sendResponse({ |
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
If the deletion has not been committed, the command below will restore the deleted file in the working tree. | |
$ git checkout -- <file> | |
You can get a list of all the deleted files in the working tree using the command below. | |
$ git ls-files --deleted | |
If the deletion has been committed, find the commit where it happened, then recover the file from this commit. | |
$ git rev-list -n 1 HEAD -- <file> | |
$ git checkout <commit>^ -- <file> |
# | |
# Working with branches | |
# | |
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" |