Skip to content

Instantly share code, notes, and snippets.

@tkrotoff
tkrotoff / svndumpfilter.rb
Last active September 30, 2015 10:37
A simple regexp to manipulate svn dump files
#!/usr/bin/env ruby
# A simple regexp to manipulate svn dump files.
#
# Example of a svn dump file:
#
# Node-path: MySourceCode.cpp
# Node-kind: file
# Node-action: add
# Prop-content-length: 10
@tkrotoff
tkrotoff / event.rb
Created October 9, 2012 13:45
Rails JSON serialization and deserialization
class Event < ActiveRecord::Base
include EventJSON
attr_accessible *EventJSON.attributes
validates :starts_at, presence: true
validates :ends_at, presence: true
validates :all_day, inclusion: { in: [true, false] }
end
@tkrotoff
tkrotoff / Log.cs
Created April 11, 2013 13:44
Enhancements for C# System.Diagnostics.Trace: add class and method names to the trace message
namespace Log
{
/// <summary>
/// Helps you trace the execution of your code.
/// </summary>
/// <remarks>
/// Same as System.Diagnostics.Trace but adds the class and method names to the trace message.<br/>
/// <br/>
/// More documentation about Trace and Debug:<br/>
/// <list type="bullet">
@tkrotoff
tkrotoff / Grids.md
Last active August 29, 2015 14:15
Popular CSS Grids

Most popular CSS grids as of February 2015

  • Stars: 77643
  • Columns: 12 by default
  • Syntax: "row", "col-md-1", "col-xs-12 col-md-8"
  • Stars: 19381
  • Columns: 12
@tkrotoff
tkrotoff / RemoveWin10DefaultApps.ps1
Last active July 12, 2024 09:05
Remove Windows 10 default apps
# See Remove default Apps from Windows 10 https://thomas.vanhoutte.be/miniblog/delete-windows-10-apps/
# See Debloat Windows 10 https://github.com/W4RH4WK/Debloat-Windows-10
# Command line to list all packages: Get-AppxPackage -AllUsers | Select Name, PackageFullName
Get-AppxPackage Microsoft.Windows.ParentalControls | Remove-AppxPackage
Get-AppxPackage Windows.ContactSupport | Remove-AppxPackage
Get-AppxPackage Microsoft.Xbox* | Remove-AppxPackage
Get-AppxPackage microsoft.windowscommunicationsapps | Remove-AppxPackage # Mail and Calendar
#Get-AppxPackage Microsoft.Windows.Photos | Remove-AppxPackage
Get-AppxPackage Microsoft.WindowsCamera | Remove-AppxPackage
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active December 27, 2024 16:04
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@tkrotoff
tkrotoff / HowToTest.md
Last active January 29, 2021 22:19
How I structure my tests

File structure

  • src/fooBar.js
  • src/fooBar.html
  • src/fooBar.scss
  • src/fooBar....
  • src/fooBar.test.js => npm run test
  • src/fooBar.test.e2e.js (if I have E2E tests - Puppeteer, Playwright...) => npm run test:e2e

Tests should not be separated from the source code (think autonomous modules).

@tkrotoff
tkrotoff / CSSFrameworks.md
Last active March 18, 2024 04:26
CSS Frameworks (Bootstrap, Tailwind CSS, Bulma, React Bootstrap, Chakra UI, Ant Design)

The right question is: is there added value in reinventing the wheel? (button, form controls, badge, card, spinner, modal...). The existing wheels will probably ride better than yours.

I would go with vanilla Bootstrap (just the Sass part, not the JS part).

Bootstrap

Bootstrap CSS utilities are very nice: same principles as Tailwind CSS.

@tkrotoff
tkrotoff / MinimalHTML5.md
Last active May 26, 2021 10:49
Minimal HTML5 structure
<!DOCTYPE html><title>Hello, World!</title>
  • doctype is mandatory
  • title is mandatory
  • head is not
  • body is not

Verified with https://validator.w3.org/

@tkrotoff
tkrotoff / ReactNative-vs-Flutter.md
Last active December 24, 2024 12:21
React Native vs Flutter