This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| import boto3 | |
| from io import StringIO | |
| def _write_dataframe_to_csv_on_s3(dataframe, filename): | |
| """ Write a dataframe to a CSV on S3 """ | |
| print("Writing {} records to {}".format(len(dataframe), filename)) | |
| # Create buffer | |
| csv_buffer = StringIO() | |
| # Write dataframe to buffer | |
| dataframe.to_csv(csv_buffer, sep="|", index=False) |
| # List all tables: | |
| select db_id, id, name, sum(rows) as mysum | |
| from stv_tbl_perm where db_id = 100546 | |
| group by db_id, id, name order by mysum desc; | |
| # list all running processes: | |
| select pid, query from stv_recents where status = 'Running'; | |
| # describe table | |
| select * from PG_TABLE_DEF where tablename='audit_trail'; |
| const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
| const asyncForEach = async (array, callback) => { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array) | |
| } | |
| } | |
| const start = async () => { | |
| await asyncForEach([1, 2, 3], async (num) => { | |
| await waitFor(50) |
| #!/bin/bash | |
| # IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it! | |
| # IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS. | |
| # This script needs to be run from the volume you wish to use. | |
| # E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh | |
| # WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars. | |
| # Get active services: launchctl list | grep -v "\-\t0" | |
| # Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents |
| #!/bin/bash | |
| if [[ "$(sw_vers -productVersion)" != 10\.15* ]]; then | |
| echo "This is only meant to run on macOS 10.15.* Catalina" >&2 | |
| exit 1 | |
| fi | |
| reply= | |
| printf "Are you pretty damn sure you want to run this? (Yes/No) " | |
| read -r reply | |
| [[ $reply != Yes ]] && exit 1 |
| ## Java | |
| sudo apt-get update | |
| sudo apt-get install default-jdk | |
| ## Scala | |
| sudo apt-get remove scala-library scala | |
| sudo wget http://scala-lang.org/files/archive/scala-2.12.1.deb | |
| sudo dpkg -i scala-2.12.1.deb | |
| sudo apt-get update | |
| sudo apt-get install scala |
| 1: import sys | |
| 2: import json | |
| 3: from pyspark import SparkContext | |
| 4: from pyspark.streaming import StreamingContext | |
| 5: | |
| 6: | |
| 7: def SaveRecord(rdd): | |
| 8: host = 'sparkmaster.example.com' | |
| 9: table = 'cats' | |
| 10: keyConv = "org.apache.spark.examples.pythonconverters.StringToImmutableBytesWritableConverter" |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
This will run the loans queue with the weight of 5
bundle exec sidekiq -q loans,5
SO: How to run Sidekiq in production