Skip to content

Instantly share code, notes, and snippets.

@suplo
suplo / gist:10718942
Created April 15, 2014 09:54
clone postgres database
createdb -O ownername -T originaldb newdb
@suplo
suplo / gist:10955408
Created April 17, 2014 05:37
play with table span css
http://jsfiddle.net/YfgPM/
sudo sed -i".bak" -e 's/\/\/us.archive.ubuntu.com/\/\/ftp.jaist.ac.jp/g' /etc/apt/sources.list
sudo php5enmod mcrypt
sudo service apache2 restart
@suplo
suplo / gist:fac473a07f0ef169286d
Created May 2, 2014 07:24
zsh-autosuggestions README
# zsh-autosuggestions
> [Fish](http://fishshell.com/)-like fast/unobtrusive autosuggestions for zsh.
> [Shelr demo](http://shelr.tv/records/527007a99660803c5d000048).
## Installation
```sh
$ git clone git://github.com/tarruda/zsh-autosuggestions ~/.zsh-autosuggestions
rdebug-ide --host 0.0.0.0 --port 7000 --dispatcher-port 26162 -- /usr/bin/passenger start -a 0.0.0.0 -p 3000 --max-pool-size 2 --spawn-method direct -e development
sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
# install postgresql
brew install postgresql
# launch (temporarily)
postgres -D /usr/local/var/postgres
# create hstore extension
psql -d rails4_test -c 'create extension hstore;'

How To Create A New Question Type (wip)

  • add a new file in app/models/quiz_question/ that extends QuizQuestion::Base (or another question type)
  • extend the appropriate scoring functions:
    • stats
    • total_answer_parts
    • correct_answer_parts
    • incorrect_answer_parts
  • requires_manual_scoring?
@suplo
suplo / gist:0f2cd2b080a7534b1945
Created May 27, 2014 04:31
Disable password login Ubuntu
9.1 The following settings should be set to no:
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
9.2. Reload the configuration:
sudo service ssh reload