Skip to content

Instantly share code, notes, and snippets.

@thomaslombart
thomaslombart / Switch.vue
Created August 24, 2020 16:03
An example of a toggle switch with Vue 3
<template>
<label class="container">
<input
v-bind="$attrs"
class="input"
type="checkbox"
:checked="checked"
@change="$emit('update:checked', $event.target.checked)"
/>
<span class="switch"></span>
@arikfr
arikfr / example.py
Created September 11, 2017 07:31
Redash API usage example
import requests
class Redash(object):
def __init__(self, redash_url, api_key):
self.redash_url = redash_url
if not self.redash_url.endswith('/'):
self.redash_url = '{}/'.format(self.redash_url)
self.auth_headers = {'Authorization': 'Key {}'.format(api_key)}
PostgreSQL Data Types AWS DMS Data Types Redshift Data Types
INTEGER INT4 INT4
SMALLINT INT2 INT2
BIGINT INT8 INT8
NUMERIC (p,s) If precision is 39 or greater, then use STRING. If the scale is => 0 and =< 37 then: NUMERIC (p,s) If the scale is => 38 and =< 127 then: VARCHAR (Length)
DECIMAL(P,S) If precision is 39 or greater, then use STRING. If the scale is => 0 and =< 37 then: NUMERIC (p,s) If the scale is => 38 and =< 127 then: VARCHAR (Length)
REAL REAL4 FLOAT4
DOUBLE REAL8 FLOAT8
SMALLSERIAL INT2 INT2
SERIAL INT4 INT4
@arikfr
arikfr / README.md
Last active May 16, 2024 16:28
Redash Query Export Tool

Setup

$ pip install click requests

Usage

$ python query_export.py --redash-url "https://app.redash.io/" --api-key ""
#Requires -Version 3.0
param($websiteNames, $jobname, $jobtype, $packOutput, $slotName = "")
$VerbosePreference = "continue"
$ErrorActionPreference = "continue"
# Helper Functions (based on or from https://github.com/aspnet/vsweb-publish/blob/master/publish-module.psm1)
function Get-MSDeploy{
[cmdletbinding()]
@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active July 8, 2024 00:56
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@rally25rs
rally25rs / FakeDbSet.cs
Created December 18, 2011 02:11
Fake implementation of Entity Framework IDbSet to use for unit testing.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
namespace Rally25rs.Gist.Data
{

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables