Skip to content

Instantly share code, notes, and snippets.

@aev-mambro2
aev-mambro2 / mssqlserver-tsql-save-varbinary-to-file.sql
Last active April 19, 2024 14:19
MSSqlServer TSQL save varbinary to file
DECLARE @local_target_path varchar(50) = 'c:\must\be\local\path'
, @adodb_file_stream int
, @create_instance_error int
, @error int
, @i bigint
, @data varbinary(max)
, @error_count int
, @error_description varchar(255)
, @error_source varchar(255)
, @file_path varchar(max)
@mmenestret
mmenestret / fp_taglessfinal_explanation.md
Last active April 19, 2024 14:19
FP and tagless final - Fabio Labella

Purity and pure FP

  • purity is a syntactical property of programs, more precisely defined as referential transparency: replacing an expression for its bound value doesn't change meaning (precise definition)
  • side effects are things that break referential transparency (precise definition)
  • There's no direct connection between the concepts of IO, State and so on, and side effects. Traditionally, these things are side effectful (break referential transparency), but you can have abstractions that are pure (don't break ref.trans.)
  • Due to the above, the term purely functional programming is not an oxymoron, it makes perfect sense.
  • In haskell style pure FP, type constructors and algebras are used to represent "things that would otherwise traditionally be side effects (break ref.trans.)". We call these F[_]s effects or computational contexts for brevity. You can see for yourself how this cannot be a precise definition (especially because they could also have kind higher than * -> *, even though most famous a
@calvinlfer
calvinlfer / README.md
Last active April 19, 2024 14:18
Developing an understanding of the FS2 Pull datatype

Developing an understanding of the FS2 Pull data type

In Pull[F, O, R], R is the return type. Pull represents a computation that emits some values on the Stream (of type O) and returns a new thing (R). In order to convert a Pull to a Stream, R must be Unit. This is because an FS2 Stream does not have the ability to terminate with a return value.

image

See here for the conversation

  • Stream[F, O] is monadic over O which are the output values emitted
  • Pull[F, O, R] is monadic over R which is used for stateful transformations
@scriptdev
scriptdev / .php
Last active April 19, 2024 14:15
COLOCAR A CORTINA LATERAL POR CIMA DA JANELA TWindow
<?php
$css_form = '
#adianti_right_panel.right-panel{
z-index : 2500 !important;
}
}';
parent::register_css('css_form', $css_form);
@AgentSingle
AgentSingle / 10d2_inputs.md
Last active April 19, 2024 14:14
Dart Tutorial

Dart inputs

stdin.readLineSync(), int.parse(stdin.readLineSync()), double.parse(stdin.readLineSync())
import 'dart:io';

void main(){
 // String Input
@jackcviers
jackcviers / Not a nightmare.md
Created March 22, 2021 21:36
Scala isn't a maintenance nightmare

So the hacker news post said my comment was too long. Warning, long, opinionated post:

Scala dev for 10+ years here. Spark is weird. Databricks has a style guide that deliberately chooses not to use scala features that the rest of the community uses, and doesn't follow the same best practices around library and scala major version usage that the rest of the community uses [1]. It's no surprise that the project has trouble interoperating with libraries outside of the spark ecosystem, and is therefore a maintenance problem.

Spark's style and compatibility problems

Scala isn't a maintenance nightmare, but it does attract a lot of newcomers who dive in, don't stick within one of its many ecosystems, get confused, and generally leave a mess, and that is a direct result of the fact that scala is a multi-paradigm, relatively expressive language to the one(s) it is competing with and pulling developers from, and that those developers, for the large part, don't really want to change and think that Scala is just a

@kennypete
kennypete / navigating_the_modes_of_Vim.md
Created April 18, 2024 20:46
Navigating the modes of Vim

Navigating the modes of Vim

This diagram illustrates navigating through Vim’s modes. It was built factoring Vim 9 (i.e., all its modes, including up to two new modes, cr and cvr, in November 2023). Information about the state() and 'showmode' is provided too.

SVG version

Some features are only available in the SVG version. It is not provided directly from within this gist’s files because SVGs do not always play nicely in GitHub (particularly, refusing to display embedded fonts).

The SVG version includes hover text help, which shows pertinent information about the underlying key, command, mode, etc.

@odigity
odigity / sequel_scopes.rb
Last active April 19, 2024 14:13
The Sequel Gem: Everything About Scopes
# (I recommend understanding the basics of this first: http://sequel.jeremyevans.net/rdoc/files/doc/object_model_rdoc.html)
# Extending the underlying dataset (http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html#label-Extending+the+underlying+dataset)
# The recommended way to implement table-wide logic by defining methods on the dataset using dataset_module:
class Post < Sequel::Model
dataset_module do
def posts_with_few_comments
where{num_comments < 30}
@scriptdev
scriptdev / .php
Last active April 19, 2024 14:13
AUMENTAR ALTURA DO DATAGRID USANDO O GRUPO DE AÇÕES
<?php
## 1 EXEMPLO ################################
$css_form = '
div > div.panel > .panel-body{
height : 45vh !important;
}
}';
@scriptdev
scriptdev / .php
Last active April 19, 2024 14:12
CONSUMINDO A API EM PHP
<?php
## EXEMPLO - CONSUMINDO A API NO POSTMAN
# https://dominio/nome_projeto/rest.php?class=ClienteRest&method=buscacpf&cpf=19178751004
# Headers
# Authorization : Basic a1cd57beca01cfbf496928ceff61281558c6726b456d71f7523c55830139
## EXEMPLO - CONSUMINDO A API EM PHP
$url = 'https://dominio/nome_projeto/rest.php';