Skip to content

Instantly share code, notes, and snippets.

View margonzalez's full-sized avatar

Martin Gonzalez margonzalez

View GitHub Profile
@Aras14HD
Aras14HD / README.md
Last active July 16, 2024 08:19
A Unified Typesystem: Partial, Variant, Borrowed Types and more

A Unified Typesystem: Partial, Variant, Borrowed Types and more

Recently I stumbled over the blog post The Inconceivable Types of Rust.

It stuck with me, the ideas were great, but felt unpolished, so I thought about it and I want to share those thoughts with you. In this post I aim to outline what these concepts are and their applications, what syntax I feel fits well, and broadly how one might design a type checker for this.

Partials

Let's start with partial types, these already kind of exist in Rust in, what Considerations on Codecrafting called it, a shadow type system. A partial types is the type of variable, that has been partially moved or initialized (or borrowed or variant). These are currently undescribable and only exist within functions, a way to write them could be:

@mathcodes
mathcodes / nosqlvssql.md
Last active August 2, 2022 23:32
NoSql vs Sql

NoSQL vs SQL Databases

Description

The following information is straight from source: https://www.mongodb.com/nosql-explained/nosql-vs-sql

TLDR: NoSQL (“non SQL” or “not only SQL”) databases were developed in the late 2000s with a focus on scaling, fast queries, allowing for frequent application changes, and making programming simpler for developers. Relational databases accessed with SQL (Structured Query Language) were developed in the 1970s with a focus on reducing data duplication as storage was much more costly than developer time. SQL databases tend to have

  • rigid
  • complex, tabular schemas
@jasonrudolph
jasonrudolph / heroku-ci-sample-timings-and-cost.md
Last active December 22, 2021 18:12
Sample timings and costs using various Heroku CI dyno types

Sample timings (in seconds)

Sample timings using Heroku CI for a small-ish Rails 6 app on various Heroku dyno types:

Dyno Type Run 1 Duration Run 2 Duration Run 3 Duration Average Duration
standard-1x 312 213 303 276
standard-2x 227 121 222 190
performance-m 162 164 175 167
performance-l 100 104 107 104
@Chocksy
Chocksy / kill_sidekiq_job.rb
Last active July 16, 2024 16:24
Kill sidekiq jobs by process id for busy jobs and by jid for other sets.
# FOR BUSY JOBS
# take the process_id from the /busy page in sidekiq and kill the longest running one.
workers = Sidekiq::Workers.new
long_process_id = 'integration.3:4:71111aaa111' # Eg: 'integration.3:4:71d1d7f4ef5a'
workers.each do |process_id, thread_id, work|
process = Sidekiq::Process.new('identity' => process_id)
process.stop! if process_id == long_process_id
end
# FOR SCHEDULED JOBS
@mankind
mankind / rails-jsonb-queries
Last active May 23, 2024 06:47
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")

tl;dr: Guia que explica qué es ssh, cómo se usa y cómo lo pueden usar de forma eficiente para facilitarles la vida con el tp


Hola!

En este documento van a encontrar información que les va a facilitar la vida en ORGA2 y otras materias, cuando quieran conectarse remotamente a los laboratorios. Espero lo lean y encuentren utilidad en el mismo :).

Decidí dividirlo en varias partes, de forma tal que pueden saltear las que no les interesen.

DISCLAIMER: No me hago cargo de nada de lo que les pueda pasar a sus computadoras o a ustedes por seguir estos consejos. Esto incluye (pero no se limita a): Perdida de acceso ssh a otros servidores, perdida de informacion en su pc local, perdida de tps, ganas de llorar, perdida de cordura y locura espontánea.

@jedp
jedp / gist:3166317
Created July 23, 2012 21:22
Logging module, file, and line number of caller
var util = require('util');
const STACK_FRAME_RE = new RegExp(/at ((\S+)\s)?\(?([^:]+):(\d+):(\d+)/);
const THIS_FILE = __filename.split('/')[__filename.split('/').length - 1];
var Logger = module.exports = function Logger() {
// I like pie
};
Logger.prototype = {