Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"authorizer","type":"address"},{"indexed":true,"internalType":"bytes32","name":"nonce","type":"bytes32"}],"name":"AuthorizationCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"authorizer","type":"address"},{"indexed":true,"internalType":"bytes32","name":"nonce","type":"bytes32"}],"name":"AuthorizationUsed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_account","type":"address"}],"name":"Blacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newBlacklister","type":"address"}],"name":"BlacklisterCh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modify from veewee | |
require 'digest/md5' | |
CURRENT_DIR = File.dirname(__FILE__) | |
PRESEED_MD5 = "#{Digest::MD5.file("#{CURRENT_DIR}/preseed.cfg").hexdigest}" | |
Veewee::Session.declare( { | |
:boot_cmd_sequence => [ | |
"<Esc><Esc><Enter>", | |
"/install/vmlinuz ", | |
"noapic ", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== Simulating browser events | |
# GET a URL, following any redirects, and making sure final page is successful | |
visit "/some/url" | |
# In general, elements can be located by their inner text, their 'title' | |
attribute, their 'name' attribute, and their 'id' attribute. | |
# They can be selected using a String, which is converted to an escaped Regexp | |
effectively making it a substring match, or using a Regexp. | |
# An exception is that using Strings for ids are compared exactly (using ==) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROOT_BACKUP_DIR=/media/RD1000/backup | |
# A list of directories to back up. Put each on its own line | |
DIR_TO_BACKUP=`cat <<EOF | |
/home/j/backup-sync | |
/var/www | |
EOF` | |
# The rsync command with options | |
BACKUP_CMD='rsync -Rvurogptl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'parslet' | |
require 'pp' | |
class HTTPParser < Parslet::Parser | |
# | |
# Character Classes | |
# | |
rule(:digit) { match('[0-9]') } | |
rule(:digits) { digit.repeat(1) } | |
rule(:xdigit) { digit | match('[a-fA-F]') } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'thread' | |
@value = 1 | |
@cond = ConditionVariable.new | |
@mutex = Mutex.new | |
t = Thread.new do | |
value = @value | |
@mutex.synchronize do | |
while true | |
STDOUT.puts value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
NewerOlder