Skip to content

Instantly share code, notes, and snippets.

@daison12006013
daison12006013 / Using Steam Deck as your device for web development.md
Last active May 2, 2024 10:33
Using Steam Deck as your device for web development
@kubopanda
kubopanda / # Q & A from Traefik Online Meetup: Deploying FastAPI apps with HTTPS powered by Traefik.md
Last active May 29, 2023 09:51
Q & A from Traefik Online Meetup: Deploying FastAPI apps with HTTPS powered by Traefik

Q & A from Traefik Online Meetup: Deploying FastAPI apps with HTTPS powered by Traefik

Question: Will you use Docker in the dev environment?

Answer: Not this time, just to save time (there's a lot to cover), although I'm sharing a couple of development tricks in the end.

Question: Why is the convention ‘app’ not 'api'?

Answer: To simplify things. It might be more familiar for people coming from other frameworks. Also because you can serve things like templates rendered on the backend, so, to avoid confusion. But you can also name the object differently if that works better for you.

@worldofpeace
worldofpeace / pantheon.md
Last active June 2, 2023 17:10
NixOS Pantheon Docs

Pantheon Desktop

Pantheon is the desktop environment created for the elementary OS distribution. It is written from scratch in Vala, utilizing GNOME technologies with GTK 3 and Granite. All of Pantheon is working in NixOS and the applications should be available, aside from a few exceptions. To enable Pantheon, set

services.xserver.desktopManager.pantheon.enable = true;
@ahmadshobirin
ahmadshobirin / set locale and timezone indonesia in laravel.md
Last active May 27, 2024 16:57
set locale and timezone indonesia in laravel

Open File App\Providers\AppServiceProvider

Change method boot

use Carbon\Carbon;


public function boot()
{
	config(['app.locale' => 'id']);
@romainl
romainl / colorscheme-override.md
Last active May 27, 2024 00:17
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Generalities first

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.
anonymous
anonymous / palindrom_dm.js
Created May 31, 2016 13:55
'use strict'; // avoid ambiguity and sloppy errors
/**
* Tests whether or not a given string is a Palindrome
* @param {string} stringToTest - the string to test.
*/
function isPalindrome(stringToTest) {
var start = 0,
end;
@benpickles
benpickles / action.js
Created March 18, 2016 16:19
Inject an Authorization header into a redux-api-middleware request with a Redux middleware.
import { CALL_API } from 'redux-api-middleware'
export function fetchLocations() {
return {
[CALL_API]: {
endpoint: 'http://api.somesite.com/api/locations',
method: 'GET',
// Don't have to manually add the Authorization header to every request.
headers: { 'Content-Type': 'application/json' },
types: ['REQUEST', 'SUCCESS', 'FAILURE']
@ericelliott
ericelliott / gitclean.sh
Created January 31, 2016 04:57
gitclean.sh - cleans merged/stale branches from origin
git remote prune origin
git branch -r --merged master | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@chantastic
chantastic / on-jsx.markdown
Last active March 20, 2024 01:03
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't