Skip to content

Instantly share code, notes, and snippets.

View Godtide's full-sized avatar
🎯
Focusing

Godtide

🎯
Focusing
View GitHub Profile
@EcZachly
EcZachly / groups.sql
Created November 6, 2023 21:11
How to write an algorithm to group people in optimized groups based on timezone and track
-- first query all the users
WITH offsets AS (SELECT a.*,
EXTRACT(hour FROM ptn.utc_offset) AS utc_offset
FROM bootcamp.attendees a
JOIN pg_timezone_names ptn ON a.timezone = ptn.name
WHERE a.bootcamp_version = 3
AND a.timezone IS NOT NULL
AND a.content_delivery = 'Live'::text
),
-- then aggregate the users by track and offset, we want matching timezones to fill up first
// contracts/GameItems.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract GameItems is ERC1155, Ownable {
@rouxcaesar
rouxcaesar / bradfield-thoughts.md
Last active April 26, 2024 21:03
Thoughts on Bradfield

My Thoughts on Bradfield

I've been asked by several people over time about my experience with the classes offered by Bradfield, and thought that I should save some future keystrokes by writing up a short gist for future reference. Hopefully this gist will be useful for others who are considering Bradfield and wondering it is worth it. My intended audience is primarily Launch School students who have completed the Core program and likely also Capstone, but the majority of this gist will be applicable to anyone who is a working/experienced software engineer.

Since late 2019, I've taken 4 short courses from the Bradfield School of Computer Science and in 2021 I enrolled in their Computer Science Intensive (CSI) program1. Overall, I've found the courses and CSI to be an excellent opportunity to grown my technical skills and broaden my knowledge of CS topics.

The courses I completed were:

  • Computer Architecture: The Hardware/Software Interface
pragma solidity ^0.5.0;
contract Base {
uint public num;
address public sender;
function setNum(uint _num) public {
num = _num;
sender = msg.sender;
}
const Web3 = require('web3');
class TransactionChecker {
web3;
web3ws;
account;
subscription;
constructor(projectId, account) {
this.web3ws = new Web3(new Web3.providers.WebsocketProvider('wss://rinkeby.infura.io/ws/v3/' + projectId));
pragma solidity >=0.7.0 <0.9.0;
contract Base {
uint public num;
address public sender;
function setNum(uint _num) public {
num = _num;
sender = msg.sender;
}
@mortenholmgaard
mortenholmgaard / Gemfile
Last active March 20, 2023 20:56
Fastlane Android app environment setup on Windows
source "https://rubygems.org"
ruby ">= 2.6.0"
gem "fastlane", ">= 2.126.0"
gem "git"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)

Prepare for SQL interview questions

Tutorial

SQL tutorial: https://tutorial.techaltum.com/SQLServer.html

Sample questions and solutions

@critesjosh
critesjosh / BaseCaller.sol
Last active August 20, 2021 13:42
Inter-contract execution in Solidity
pragma solidity ^0.5.0;
contract Base {
uint x;
constructor() public {
x = 10;
}
pragma solidity ^0.4.15;
contract StringsAndBytes {
/* --- public variables for storing tests results */
string public lastTestStringResult; //
bytes32 public lastTestBytes32Result; //
bytes public lastTestBytesResult; // bytes: dynamically-sized byte array
bool public lastTestBoolResult; //