- Data types
- Basic syntax
- Objects, data types/structures (basic)
- Ecosystem – gems, docs; C extensions
- Blocks & loops
Advanced:
while true; do PGCONNECT_TIMEOUT=2 psql -U receiptbank -h monolith-postgresql --list >/dev/null && date +'Host: %Y-%m-%d %H:%M:%S.%6N' || echo -n .; sleep 0.05; done | |
while true; do PGCONNECT_TIMEOUT=2 psql -U receiptbank -h 0.0.0.0 --list >/dev/null && date +'IP: %Y-%m-%d %H:%M:%S.%6N' || echo -n .; sleep 0.05; done | |
while true; do PGCONNECT_TIMEOUT=2 psql -U receiptbank --list >/dev/null && date +'Sock: %Y-%m-%d %H:%M:%S.%6N' || echo -n .; sleep 0.05; done | |
while ! kubectl -n probes logs --timestamps -f `kubectl get pods -n probes -l app=monolith -l component=postgresql --show-kind=false --no-headers 2>/dev/null|cut -d' ' -f1`; do echo -n .; sleep 0.1; done | |
while ! kubectl-exec-in probes `kubectl get pods -n probes -l app=monolith -l component=postgresql --show-kind=false --no-headers 2>/dev/null|cut -d' ' -f1` /bin/bash -lc "while true; do PGCONNECT_TIMEOUT=2 psql -U postgres -h 0.0.0.0 --list >/dev/null && date +'IP: %Y-%m-%d %H:%M:%S.%6N' || echo -n .; sleep 0.05; done" 2>/dev/null; do echo -n .; slee |
var emails = ['someone@example.com', 'another.example.com']; | |
var index = 0; | |
function inviteNextPerson() { | |
if (index >= emails.length) return; | |
var email = emails[index]; | |
var input = $('input[name=invite]'); | |
var submit = $('button[type=submit].solid.info.fat'); |
require 'open3' | |
class Command | |
def run(command, stdout_callback, stderr_callback) | |
Open3.popen3(command) do |stdin_write_io, stdout_read_io, stderr_read_io, process_wait_thread| | |
# We don't care about STDIN | |
stdin_write_io.close | |
stdout_reader = read_without_blocking_from(stdout_read_io, stdout_callback) | |
stderr_reader = read_without_blocking_from(stderr_read_io, stderr_callback) |
update wp_options set option_value = 'a:5:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:62:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:2 |
require 'thread' | |
require 'bunny' | |
c = Bunny::Session.new(continuation_timeout: 1_000) | |
c.start | |
ch = c.create_channel | |
ch.confirm_select |
require 'thread' | |
require 'bunny' | |
operations_log = [] | |
operations_log_mutex = Mutex.new | |
c = Bunny::Session.new | |
c.start | |
ch = c.create_channel |
#!/bin/bash | |
duration="$1" | |
if [ -z "$duration" ]; then | |
echo "Usage: $0 <duration> where duration is a number in seconds, or a number with an m or a h suffix." >&2 | |
echo "Examples:" >&2 | |
echo "$0 10" >&2 | |
echo "$0 15m" >&2 | |
exit 1 |