Reading and Writing Element Attributes
Remember:
<element attribute="value">InnerHTML</element>
Example:
import random | |
g = random.randrange(-10, 11, 1) | |
f = random.randrange(-10, 11, 1) | |
a = [] | |
for i in range(0,10): | |
try: | |
x = int(input(" %d" %g + " + " + "%d = " %f)) |
{ | |
"window.zoomLevel": 0, | |
"editor.minimap.enabled": false, | |
"editor.fontFamily": "'monospace'", | |
"editor.fontSize": 14, | |
"files.exclude": { | |
"**/node_modules": true | |
}, | |
"files.defaultLanguage": "txt", | |
"workbench.startupEditor": "newUntitledFile", |
<div class="btn-group mt-1 mx-auto"> | |
<button id="gantt-day" type="button" class="gantt-period btn btn-sm btn-secondary">Day</button> | |
<button id="gantt-week" type="button" class="gantt-period btn btn-sm btn-secondary">Week</button> | |
<button id="gantt-month" type="button" class="gantt-period btn btn-sm btn-secondary">Month</button> | |
</div> | |
<script> | |
document.querySelectorAll(".gantt-period").forEach(function(button) { | |
button.addEventListener("click", function(event) { | |
railsGantt.gantt.change_view_mode(event.currentTarget.innerHTML); |
#!/bin/sh | |
mkdir $1 && cd $1 | |
yarn init | |
yarn add webpack webpack-dev-server \ | |
babel-core babel-preset-es2015 \ | |
babel-loader sass-loader css-loader style-loader \ | |
extract-text-webpack-plugin \ | |
node-sass --dev |
These are the very basics of reading and writing to CSV files in Ruby. For more details and other available options consider checking out the full documentation: here
Consider a given csv file scientists.csv
with the following content:
for project_dir in */; do | |
cd "$project_dir" | |
git checkout master | |
git checkout -- . | |
git pull | |
bundle install | |
yarn install | |
rails db:drop db:create db:migrate db:seed | |
cd .. | |
done |
class Threater | |
def self.run(iterations = 1_000_000) | |
last_person_got_seat = 0.0 | |
total_runs = 0.0 | |
iterations.times do |i| | |
if i % 1000 == 0 | |
print("\rNº of iterations: #{i.to_s.ljust(iterations.to_s.length)}") | |
end | |
last_person_got_seat += 1 if new.last_person_got_seat |