Skip to content

Instantly share code, notes, and snippets.

let hello = "a string";
hello = '5';
const shouldBeAString: boolean = true;
function addOne(x: number) {
return x + 1;
}
let hello = "a string";
hello = 5;
const shouldBeAString: string = true;
function addOne(x: number) {
return x + 1;
}
@danielgek
danielgek / getAllEmailsFromSlackChannel.js
Created August 23, 2021 14:28
getAllEmailsFromSlackChannel
const fetch = require('node-fetch');
const getChannelInfo = async (channelName) => {
return fetch(`https://slack.com/api/conversations.list?token=${TOKEN}`, {
"headers": {
"accept": "*/*",
"accept-language": "en-US",
}, "method": "GET",
@danielgek
danielgek / Makefile
Created June 3, 2021 19:53 — forked from ddevault/Makefile
Tiny Wayland compositor
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
@danielgek
danielgek / useFetchStateMachine.ts
Created April 16, 2021 11:00 — forked from pffigueiredo/useFetchStateMachine.ts
Fetch reducer state machine with typescript support
import { Dispatch, Reducer, useReducer } from 'react';
type Nullable<T> = T | None;
type FetchMachineState<DataT, ErrorT> = {
status: 'idle' | 'loading' | 'success' | 'failure';
data: Nullable<DataT>;
error: Nullable<ErrorT>;
};
const path = require('path');
const fs = require('fs');
const Airtable = require('airtable');
const AIRTABLE_API_KEY = process.env.AIRTABLE_API_KEY;
const AIRTABLE_BASE = process.env.AIRTABLE_BASE;
Airtable.configure({
endpointUrl: 'https://api.airtable.com',
apiKey: AIRTABLE_API_KEY,
// all credits go to https://github.com/AnthonySLWhite
import { screens } from 'styles/theme';
import { useMediaSet } from 'use-media-set';
export type MediaProps<T extends string> = {
[key in T]: {
minWidth?: number | string;
minHeight?: number | string;
maxWidth?: number | string;
.action-bar {
 padding-top: 24; 
}
import * as application from ‘application’;
import { Color } from ‘color’;
let window = application.android.foregroundActivity.getWindow();
window.setStatusBarColor(new Color('red').android);
.action-bar {
 background-color: red;
 color: white;
}