Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, https://github.com/ondras/wwwsqldesigner/ -->
<!-- Active URL: http://ondras.zarovi.cz/sql/demo/ -->
<sql>
<datatypes db="mssql">
<group label="Integer" color="rgb(238,238,170)">
<type label="TinyInt" length="0" sql="tinyint" re="INT" quote="" bytes="1" note="Integer data: 0 to 255"/>
<type label="SmallInt" length="0" sql="smallint" re="INT" quote="" bytes="2" note="Integer data: -32,768 to 32,767"/>
<type label="Int" length="0" sql="int" re="INT" quote="" bytes="4" note="Integer data: -2,147,483,648 to 2,147,483,647"/>
<type label="BigInt" length="0" sql="bigint" re="INT" quote="" bytes="8" note="Integer data: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807"/>
@Adrek
Adrek / jwt-payload-parse.dart
Created November 23, 2019 16:52 — forked from hjJunior/jwt-payload-parse.dart
Get payload of JWT token in Dart language
import 'dart:convert';
Map<String, dynamic> parseJwt(String token) {
final parts = token.split('.');
if (parts.length != 3) {
throw Exception('invalid token');
}
final payload = _decodeBase64(parts[1]);
final payloadMap = json.decode(payload);
@Adrek
Adrek / button_raised.dart
Last active December 15, 2019 17:03
Button Raised Flutter. Falta mejorar
Widget _botonIngresar() {
return Container(
decoration: BoxDecoration(
color: Color(0xFFa3137b),
borderRadius: BorderRadius.all(Radius.circular(30)),
),
width: double.infinity,
child: Material(
child: InkWell(
onTap: () {
@Adrek
Adrek / plugins.md
Created February 16, 2020 11:59 — forked from Klerith/plugins.md
Flutter: Curso de Flutter - Instalaciones recomendadas
@Adrek
Adrek / slim-stream-route.php
Last active June 4, 2020 19:26 — forked from james2doyle/slim-stream-route.php
Create a streaming download of a large file with Slim PHP using the build in Stream class
<?php
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Http\Stream;
$app->get('/stream', function (Request $request, Response $response, array $args) {
// a 100mb file
$path = '../public/files/document.pdf';
@Adrek
Adrek / portainer.md
Created October 18, 2020 18:21 — forked from SeanSobey/portainer.md
Portainer Setup on Windows 10

Portainer on Windows 10

Here I have 2 methods for running portainer on windows, a quick, preferred method only requiring a fairly recent version of docker, or a more complicated method to try if that does not work.

Using docker.for.win.localhost

This setup will let you run Portainer on windows by using the docker.for.win.localhost endpoint.

Please note:

@Adrek
Adrek / debouncer.dart
Created February 7, 2021 13:18 — forked from Klerith/debouncer.dart
Dart: Debouncer
import 'dart:async';
// Creditos
// https://stackoverflow.com/a/52922130/7834829
class Debouncer<T> {
Debouncer({ this.duration, this.onValue });
final Duration duration;
void Function(T value) onValue;
@Adrek
Adrek / dio_api_helper.dart
Created February 24, 2021 16:18 — forked from RyanDsilva/dio_api_helper.dart
Flutter Dio Helper Class
import 'package:dio/dio.dart';
class ApiBaseHelper {
static final String url = 'BASE_URL';
static BaseOptions opts = BaseOptions(
baseUrl: url,
responseType: ResponseType.json,
connectTimeout: 30000,
receiveTimeout: 30000,
);
@Adrek
Adrek / types.ts
Created May 3, 2021 01:04 — forked from danirod/types.ts
Algo que he aprendido hoy sobre tipos en TypeScript.
/**********************************************************
* COSAS SIMPLES CON TIPOS PARA IR ABRIENDO BOCA.
*********************************************************/
/* Una interfaz que maneja datos en una agenda de contactos. */
interface Person {
/* Datos personales sobre esta persona. */
name: string;
age: number;
city: string;
@Adrek
Adrek / column_reorder.sql
Created July 3, 2021 23:51 — forked from iangow/column_reorder.sql
Change order of columns in PostgreSQL
CREATE TABLE tone_data_temp AS
SELECT file_name, last_update, category, word_count, litigious,
positive, uncertainty, negative, modal_strong, modal_weak
FROM bgt.tone_data;
DROP TABLE bgt.tone_data;
ALTER TABLE tone_data_temp RENAME TO tone_data;
ALTER TABLE tone_data SET SCHEMA bgt;