##Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:alexpchin/.git
##Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:alexpchin/.git
| #!/bin/bash | |
| YOUR_WINDOWS_USERDIRECTORY_NAME_HERE="" | |
| WIN_TEMP_PATH="/mnt/c/Users/$YOUR_WINDOWS_USERDIRECTORY_NAME_HERE/AppData/Local/Temp" | |
| CURRENT_DIR=`pwd` | |
| if [ $# -eq 0 ] | |
| then | |
| echo "No arguments supplied" | |
| exit 1 |
| curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}' |
| #Not my code, this is from Mike Pfeiffer - http://mikepfeiffer.net/2010/03/how-to-merge-pdf-files-using-powershell-and-pdfsharp/ | |
| #Requires PDFSharp assembly libraries http://sourceforge.net/projects/pdfsharp/ | |
| #You need to load the assembly before you can use the function | |
| # | |
| #Merge-PDF -path c:\pdf_docs -filename c:\saved_docs.pdf | |
| Add-Type -Path C:\assemblies\PdfSharp.dll | |
| Function Merge-PDF { |
| Updating WSL | |
| Updating Packages in WSL | |
| Because WSL uses a standard Ubuntu installation, upgrading your packages should look very familiar: | |
| $ sudo apt-get update | |
| $ sudo apt-get upgrade | |
| Updating the Ubuntu OS | |
| You can aso upgrade to the latest version of Ubuntu with the following command (caution, this will take quite some time)!: |
| Install PostgreSQL using WSL | |
| This doc explains how to install PostgreSQL 10 for Windows WSL | |
| We are installing this through the Ubuntu command line since we want this software to run in the Linux environmnet. You can check out the PostgreSQL Linux install docs here. | |
| Install | |
| Open a terminal (the Ubuntu app) and then go to the root of the Ubuntu Subsystem by typing cd ~ . | |
| Type sudo nano ../../etc/apt/sources.list. This will open a file on Ubuntu using the Nano editor. | |
| At the bottom of this file, paste in this line deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main | |
| Change the last part of the line above from xenial- to whichever version of Ubunutu you are running. |
| function move(n, a, b, c) { | |
| if (n > 0) { | |
| move(n-1, a, c, b); | |
| console.log("Move disk from " + a + " to " + c); | |
| move(n-1, b, a, c); | |
| } | |
| } | |
| move(4, "A", "B", "C"); |
| #!/bin/bash | |
| sudo apt-get update | |
| sudo apt-get install dosbox wget | |
| mkdir -p wolf3d | |
| cd wolf3d | |
| wget http://image.dosgamesarchive.com/games/1wolf14.zip | |
| unzip *.zip | |
| dosbox INSTALL.EXE | |
| echo "After setup cd into the new wolf3d directory" |
| #!/bin/bash | |
| sudo apt-get update | |
| sudo apt-get install dosbox wget | |
| mkdir -p wolf3d | |
| cd wolf3d | |
| wget http://image.dosgamesarchive.com/games/1wolf14.zip | |
| unzip *.zip | |
| dosbox INSTALL.EXE | |
| echo "After setup cd into the new wolf3d directory" |
| # The idea is just to illustrate that Ruby's #map and #select Enumerable methods | |
| # are simply specific flavours of a fold operation, which Ruby implements as #inject. | |
| # I've implemented #map and #select using #inject, and at the end I implemented #inject | |
| # recursively. Ruby does #inject with Array#each, for very good reason. The recursive | |
| # implementation is really just to illustrate the core Functional Programming concept | |
| # which it derives from. | |
| # We'll start simple. Map without applying a function: | |
| [1,2,3,4,5].inject([]) {|memo, obj| memo << obj } |