Skip to content

Instantly share code, notes, and snippets.

View adamnoto's full-sized avatar

Adam adamnoto

View GitHub Profile
@adamnoto
adamnoto / gcc_funcs_sym.c
Last active May 24, 2025 11:44
PL Lab: Interpreter vs Compiled Language
/*
Two tables are printed: the symbol table and the string table.
The hierarchy are implied through nesting. Hence, any nested
table has at least one table a level higher than itself representing
an outer table. A table might have siblings, and while they're printed
at the same level, they are distinct and separate to each other.
Legends:
TBL: Table

List of Chrome Driver command line arguments

Here is the list of Chrome Driver command line Arguments.

If you are using chrome Driver for Selenium WebDriver or Protractor or …. then these are a handy useful list of command line arguments that can be used.

You may use this to look at the usuage: https://code.google.com/p/chromium/codesearch#chromium/src/chromeos/chromeos_switches.cc

Run chromedriver –help to see command line arguments for your version.

@adamnoto
adamnoto / gist:17b297db59a4d1a33fcbf394699aeeb2
Last active February 13, 2022 01:34
Differences of Redis Lock

Review of redis-lock

  • A Lock is a struct consisting of:
    • client: the RedisClient
    • key: user-defined value
    • opts: an object of LockOptions
    • token: generated by the library on various life cycles from obtaining a lock, refreshing to releasing it
    • mutex: an instance of sync.Mutex to enure atomicity/exclusivity of certain operations, such as:
      • checking when it IsLocked()
  • performing a Lock()
@adamnoto
adamnoto / the-algebra-of-algebraic-data-types.md
Created October 3, 2021 00:00 — forked from gregberns/the-algebra-of-algebraic-data-types.md
The Algebra of Algebraic Data Types, Part 1, by Chris Taylor
@adamnoto
adamnoto / rails http status codes
Created May 24, 2020 03:51 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@adamnoto
adamnoto / AWS_Single_LetsEncrypt.yaml
Created May 17, 2020 06:41 — forked from tony-gutierrez/AWS_Single_LetsEncrypt.yaml
AWS Elastic Beanstalk .ebextensions config for single instance free SSL using letsencrypt certbot and nginx. http://bluefletch.com/blog/domain-agnostic-letsencrypt-ssl-config-for-elastic-beanstalk-single-instances/
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too.
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
@adamnoto
adamnoto / adamtheengineer_phoenix14_app.scss
Created October 14, 2019 08:12
for the post about "Add Bootstrap to Phoenix 1.4" => app.scss
@import '~bootstrap/scss/bootstrap.scss';
@import '~font-awesome/scss/font-awesome.scss';
@adamnoto
adamnoto / adamtheengineer_phoenix14_app.js
Created October 14, 2019 08:10
for the post about "Add Bootstrap to Phoenix 1.4" => app.js
import css from "../css/app.scss" // ensure .scss!!!
import $ from "jquery"
global.jQuery = $
global.$ = $
require('bootstrap')
@adamnoto
adamnoto / adamtheengineer_phoenix14_webpack.config.js
Last active October 14, 2019 14:11
for the post about "Add Bootstrap to Phoenix 1.4" => webpack.config.js
// snip snip...
module.exports = (env, options) => ({
// snip snip...
module: {
rules: [
// .. some more snip snip..
{
test: /\.s?css$/,
// add sass-loader here
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']
date_activity = Date.current.beginning_of_year
query = <<-sql.squish
SELECT * FROM some_table
WHERE booked_at >= CAST("#{date_activity.strftime("%Y-%m-%d")}" AS DATE)
sql
Etl::BigQueryLoadQueryService.new(
query: query,
dataset: 'statistics',