Skip to content

Instantly share code, notes, and snippets.

@ftijan
ftijan / SetIisCredentials.bat
Last active May 22, 2021 17:46
Set custom IIS App Pool credentials with appcmd
%windir%\system32\inetsrv\appcmd.exe set config /section:applicationPools /[name='APP_POOL_NAME'].processModel.identityType:SpecificUser /[name='APP_POOL_NAME'].processModel.userName:DOMAIN\USER_NAME /[name='APP_POOL_NAME'].processModel.password:PASSWORD
@ftijan
ftijan / MultipleCancellationTokenScenarios.cs
Created May 22, 2021 17:44
CancellationToken scenarios
// Some scenarios to handle cancellations coming from multiple sources
// or manually cancelling tasks without cancellation tokens
// Taken from the .Net Background Service approach
// https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/BackgroundService.cs
// 1) with CancellationTokenSource.CreateLinkedTokenSource(...)
// Create linked token to allow cancelling executing task from provided token:
_stoppingCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
@ftijan
ftijan / VS-IISExpress-64-bit.txt
Last active July 17, 2022 13:31
Enabling 64-bit app debug for IIS Express in Visual Studio
To enable:
- Tools -> Options
- Projects and Solutions -> Web Projects
- Use the 64-bit version of IIS Express for websites and projects -> check
@ftijan
ftijan / kafka-docker-compose.yml
Last active July 17, 2022 13:32
An example of a Docker compose config for a local Kafka+Zookeeper environment
# taken from: https://www.baeldung.com/ops/kafka-docker-setup
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- 22181:2181

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@ftijan
ftijan / steve-yegge-platform-rant-follow-up.md
Created July 22, 2021 19:45 — forked from kislayverma/steve-yegge-platform-rant-follow-up.md
The one after platforms where Steve Yegge shares Amazon war stories

By Steve Yegge

Last week I accidentally posted an internal rant about service platforms to my public Google+ account (i.e. this one). It somehow went viral, which is nothing short of stupefying given that it was a massive Wall of Text. The whole thing still feels surreal.

Amazingly, nothing bad happened to me at Google. Everyone just laughed at me a lot, all the way up to the top, for having committed what must be the great-granddaddy of all Reply-All screwups in tech history.

But they also listened, which is super cool. I probably shouldn’t talk much about it, but they’re already figuring out how to deal with some of the issues I raised. I guess I shouldn’t be surprised, though. When I claimed in my internal post that “Google does everything right”, I meant it. When they’re faced with any problem at all, whether it’s technical or organizational or cultural, they set out to solve it in a first-class way.

Anyway, whenever something goes viral, skeptics start wondering if it was faked or staged. My accident

@ftijan
ftijan / bundle-analyze-steps.txt
Created January 2, 2022 17:48
JS app bundle analyzer tools
/* https://github.com/webpack-contrib/webpack-bundle-analyzer */
npm install webpack-bundle-analyzer --save-dev
ng build --stats-json
npx webpack-bundle-analyzer dist/my-app/stats.json
/* https://github.con/danvk/source-map-explorer */
npm install source-map-explorer --save-dev
ng build
npx source-map-explorer dist/my-app/main.js
@ftijan
ftijan / example-postcss-plugin.js
Last active July 17, 2022 13:29
A PostCSS plugin example
// Based on the example in the PluralSight course 'Improving CSS with PostCSS':
// https://app.pluralsight.com/library/courses/improving-css-with-postcss/table-of-contents
var postcss = require('postcss');
module.exports = postcss.plugin('example-postcss-plugin', function() {
return function(css) {
// walk all the CSS rules in the AST
css.walkRules(function(rule) {
// walk all declarations in the rule
@ftijan
ftijan / index.html
Last active July 17, 2022 13:25
Animated loading spinner in HTML and CSS
<!-- example taken from the Web Dev Simplifed tutorial 'How To Create An Advanced Animated Loading Spinner': -->
<!-- https://youtu.be/Gx35fMhDPWs -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
@ftijan
ftijan / .vimrc
Last active May 25, 2024 00:45
A simple vim config file
" basic vi settings
set number " line numbers
set numberwidth=2 " line numbers width
set tabstop=2 " tabstop
set shiftwidth=2 " indentation
set smarttab " adjust tab key presses
set softtabstop=2 " 2-column tabs
set mouse=a " use mouse
set encoding=UTF-8 " set default encoding to utf-8
set background=dark " set background color (used for status line)