Skip to content

Instantly share code, notes, and snippets.

View tsega's full-sized avatar
🏰
Working from home

Tsegaselassie Tadesse tsega

🏰
Working from home
View GitHub Profile
@henrik
henrik / .bashrc
Created December 3, 2008 17:56
Git branch and dirty state in Bash prompt.
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
# Atom Cheatsheet.
# Project Key Bindings.
- 'cmd-shift-p': open the command palette.
- 'cmd-p' or 'cmd-t': open the fuzzy finder to find a file.
- 'cmd-b': look for a file that is already open.
- 'cmd-shift-b': search the list of files modified and untracked in your project repository.
- 'ctrl-0': open and focus the the tree view.
@ldong
ldong / download_egghead_videos.md
Last active December 7, 2023 16:16
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});
@alanorth
alanorth / ciat-reports.csv
Last active November 6, 2018 07:23
Read CSV, fetch PDFs, and generate thumbnails. The filename column is derived from the dc.identifier.url field (using split in OpenRefine, but could be done elsewhere obviously), and we should watch out for URL encoded stuff (ugh).
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
cg.subject.ciat,dc.contributor.author,dc.contributor.corporate,dc.cplace.country,dc.date.issued,dc.description.abstract,dc.identifier.citation,dc.identifier.status,dc.identifier.uri,dc.identifier.url,filename,dc.language.iso,dc.publisher,dc.rplace.region,dc.subject,dc.title,dc.type.output
POLICY||NUTRITION,"Pachico, DH||Seré Rabé, C",,,1981,,"Pachico, Douglas H.; Seré Rabé, Carlos. 1981. Food consumption patterns and malnutrition in Latin America : Some issues for commodity priorities and policy analysis. Centro Internacional de Agricultura Tropical (CIAT), Cali, CO. 36 p.",Open Access,,http://ciat-library.ciat.cgiar.org/ciat_digital/CIAT/64661.pdf,64661.pdf,en,Centro Internacional de Agricultura Tropical (CIAT),LATIN AMERICA,FOOD CONSUMPTION||MALNUTRITION||LATIN AMERICA||CONSUMO DE ALIMENTOS||MALNUTRICIÓN||AMÉRICA LATINA,Food consumption patterns and malnutrition in Latin America : some issues for commodity priorities and policy analysis,Report
MONITORING AND REPORTING,"Woolley, JN||Pachico, DH",,,1987,,"Woo
@lmcneel
lmcneel / remove-node-modules.md
Last active July 27, 2024 11:24
How to remove node_modules after they have been added to a repo

How to remove node_modules

Create a .gitignore file

  1. Check for an existing .gitignore file in the project directory
ls -a
@sveggiani
sveggiani / instructions.md
Last active July 15, 2023 21:52
[Configure XDebug, Visual Studio Code for a Vagrant VM] #debug #vm #vscode #masscode

Configure XDebug, Visual Studio Code for a Vagrant VM

1. Assumptions

  • Project (Drupal) is served on /var/www/html in the Vagrant box
  • Local project files location: c:\Users\username\Work\projects\my-project\repo\html
  • Guest machine IP is 10.0.2.2 (if this doesn't work, run route -nee in the VM and look for the gateway address)

2. Configuration