Skip to content

Instantly share code, notes, and snippets.

View Destaq's full-sized avatar
🔨
probably building~

Simon Ilincev Destaq

🔨
probably building~
View GitHub Profile
@ikashnitsky
ikashnitsky / odds-world-cups.R
Created December 4, 2022 21:06
(comparison with previous years) Were there too many sensations at FIFA World Cup in Qatar?
#===============================================================================
# 2022-12-04 -- misc
# get oddsportal data
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com, @ikashnitsky
#===============================================================================
library(tidyverse)
library(magrittr)
library(ggrepel)
library(sysfonts)
@imaurer
imaurer / char_ratios.py
Created October 29, 2019 13:32
Relative Widths of Non-Fixed-Width Font Example from Stack Overflow
{'a': 60,
'b': 60,
'c': 52,
'd': 60,
'e': 60,
'f': 30,
'g': 60,
'h': 60,
'i': 25,
'j': 25,
@mkjiau
mkjiau / axios-interceptors-refresh-token.js
Last active March 13, 2024 10:59
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
@dannguyen
dannguyen / guardian-articles-day-api.md
Last active November 23, 2023 12:28
How to use The Guardian's API to download article data for content analysis (in Python 3.x)

How to use The Guardian's API to download article data for content analysis (in Python 3.x)

The Guardian offers an API as deep and robust as the New York Times Article API when it comes to content analysis.

The Guardian's API offers more than "1.7 million pieces of content", with published items as far back as 1999. You can register as a developer here, which gets you 5,000 API hits a day and an API key that looks something like this:

zzzyyyyy-9a9z-999z-z999-9e8a83922516

The Guardian has a handy interactive explorer to interactively tweak the query parameters.

@alexedwards
alexedwards / gist:dc3145c8e2e6d2fd6cd9
Last active May 28, 2024 20:35
Example of working with Go's database/sql and NULL fields
CREATE TABLE books (
isbn char(14) NOT NULL,
title varchar(255),
author varchar(255),
price decimal(5,2)
);
INSERT INTO books (isbn, title, author, price) VALUES
('978-1503261969', 'Emma', 'Jayne Austen', 9.44),
('978-1514274873', 'Journal of a Soldier', NULL, 5.49),
@zyxar
zyxar / exercise.tour.go
Last active April 28, 2024 17:06
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@clintel
clintel / gist:1155906
Created August 19, 2011 02:40
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code