Skip to content

Instantly share code, notes, and snippets.

Avatar
🛠️
creatin' some stuff

Tomasz Ducin ducin

🛠️
creatin' some stuff
View GitHub Profile
@ducin
ducin / api.md
Last active Nov 16, 2020
Mock REST API typings and cheat sheet
@ducin
ducin / console-load-js-script.js
Last active Nov 6, 2020
load js script from blank page browser (execute following code in the browser console)
View console-load-js-script.js
(function(root){
root.getScript = function(url) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
document.head.appendChild(script);
}
}(window));
getScript('http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.js');
@ducin
ducin / console.py
Last active Jun 18, 2020
Python script opening interactive console with current interpreter state. Thanks to readline/rlcompleter, you may use up/down arrows (history browse) or left/right arrows (line edition), see http://stackoverflow.com/questions/19754458/python-open-interactive-console-from-script)
View console.py
"""
Console module provide `copen` method for opening interactive python shell in
the runtime.
"""
import code
import readline
import rlcompleter
def copen(_globals, _locals):
@ducin
ducin / .gitignore
Last active Feb 3, 2020
typescript namespaces example
View .gitignore
dist
node_modules
npm-debug.log
@ducin
ducin / ecommerce-order.json
Created Jan 26, 2020
various json schemas
View ecommerce-order.json
{
"type": "object",
"properties": {
"orderId": {
"type": "string",
"faker": "random.uuid"
},
"customer": {
"type": "string",
"faker": "name.findName"
@ducin
ducin / ^.md
Last active Sep 3, 2019
Functional Composition with Static Types in TypeScript, Tomasz Ducin, Warsaw TypeScript #2, 2019.02.06
View ^.md
@ducin
ducin / actions.ts
Last active Jun 5, 2019
redux setup
View actions.ts
import { INC } from './constants';
export const Inc = () => ({
type: INC as typeof INC
})
export type Actions =
| ReturnType<typeof Inc>
@ducin
ducin / ^.md
Last active Mar 28, 2019
Functional Composition with Static Types in TypeScript, Tomasz Ducin, Wrocław TypeScript #3, 2019.03.27
View ^.md
@ducin
ducin / LICENSE
Created Dec 28, 2018
Lorem Ipsum License
View LICENSE
Lorem Ipsum License
Copyright (c) [year] [fullname]
Permission is Lorem ipsum hereby granted, dolor sit amet, free of charge,
to any person obtaining a copy consectetur adipiscing elit. Proin nibh augue
of this software and associated documentation files (the "Software"),
suscipit a, scelerisque sed, to deal lacinia in, mi. Cras vel lorem.
Etiam pellentesque aliquet tellus, in the Software without restriction,
Phasellus pharetra nulla ac diam. Quisque semper justo at risus including
View .gitignore
node_modules