Skip to content

Instantly share code, notes, and snippets.

View lcfd's full-sized avatar
🦙

Luca Fedrizzi lcfd

🦙
View GitHub Profile
@lcfd
lcfd / hn.ts
Last active September 29, 2020 22:22
import * as colors from "https://deno.land/std/fmt/colors.ts";
const BASE_PATH = "https://hacker-news.firebaseio.com/v0/";
const get_top_stories = async () => {
console.info(
`
/$$ /$$ /$$ /$$ /$$
| $$ | $$ | $$ | $$$ | $$
| $$ | $$ /$$$$$$ /$$$$$$$| $$ /$$ /$$$$$$ /$$$$$$ | $$$$| $$ /$$$$$$ /$$ /$$ /$$ /$$$$$$$
@lcfd
lcfd / dc.sh
Last active February 19, 2019 16:55
Create a Django project with just one command.
#!/usr/bin/env bash
echo "
██████╗ ██╗ █████╗ ███╗ ██╗ ██████╗ ██████╗ ██████╗
██╔══██╗ ██║██╔══██╗████╗ ██║██╔════╝ ██╔═══██╗██╔══██╗
██║ ██║ ██║███████║██╔██╗ ██║██║ ███╗██║ ██║██████╔╝
██║ ██║██ ██║██╔══██║██║╚██╗██║██║ ██║██║ ██║██╔══██╗
██████╔╝╚█████╔╝██║ ██║██║ ╚████║╚██████╔╝╚██████╔╝██║ ██║
╚═════╝ ╚════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝
@lcfd
lcfd / cloudSettings
Last active July 1, 2021 16:16
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-07-01T16:16:29.144Z","extensionVersion":"v3.4.3"}
@lcfd
lcfd / vscode-styles.css
Created May 22, 2017 08:14
vscode-styles for operator mono, fira code ligatures, and oceanic next italic
.type.storage,.type.storage.declaration, .storage.class.modifier {
font-family: 'Operator Mono Book';
}
.type.storage.arrow.function {
font-family: 'Fira Code'
}
.token.keyword.operator {
font-family: 'Fira Code'
@lcfd
lcfd / prototypes.js
Last active March 3, 2017 15:36
A collection of useful prototypes that I use.
/**
* First letter of a string converted into uppercase
*/
String.prototype.capitalizeFirstLetter = function () {
return this
.charAt(0)
.toUpperCase() + this.slice(1);
}
/**
@lcfd
lcfd / Promise.js
Created February 8, 2017 15:51
Es6 and Promise example
var pr1 = new Promise((resolve, reject) => {
setTimeout(function () {
resolve([1,3,4,46,234,33,4,536]);
}, 500);
})
var pr2 = new Promise((resolve, reject) => {
setTimeout(function () {
resolve(20);
}, 1000);
@lcfd
lcfd / ReduxMicroBoilerplate.js
Created December 2, 2016 13:31 — forked from gaearon/ReduxMicroBoilerplate.js
Super minimal React + Redux app
import React, { Component } from 'react';
import { createStore, combineReducers, applyMiddleware, bindActionCreators } from 'redux';
import { provide, connect } from 'react-redux';
import thunk from 'redux-thunk';
const AVAILABLE_SUBREDDITS = ['apple', 'pics'];
// ------------
// reducers
// ------------
@lcfd
lcfd / .babelrc
Last active November 15, 2016 10:02 — forked from albertfdp/webpack.config.js
All kinds of webpack configs. [ normal, react + .babelrc ]
{
"presets": ["react", "es2015", "stage-0"]
}
@lcfd
lcfd / flux.js
Created September 21, 2016 06:54 — forked from acdlite/flux.js
A Redux-like Flux implementation in <75 lines of code
/**
* Basic proof of concept.
* - Hot reloadable
* - Stateless stores
* - Stores and action creators interoperable with Redux.
*/
import React, { Component } from 'react';
export default function dispatch(store, atom, action) {
@lcfd
lcfd / Python3 Virtualenv Setup
Created July 20, 2016 06:49 — forked from evansneath/Python3 Virtualenv Setup
Setting up and using Python3 Virtualenv
To install virtualenv via pip
$ pip3 install virtualenv
Note that virtualenv installs to the python3 directory. For me it's:
$ /usr/local/share/python3/virtualenv
Create a virtualenvs directory to store all virtual environments
$ mkdir somewhere/virtualenvs
Make a new virtual environment with no packages