Skip to content

Instantly share code, notes, and snippets.

@kskhannaio
kskhannaio / CircleButtonStyle.xaml
Created February 22, 2021 07:29 — forked from colinkiama/CircleButtonStyle.xaml
Perfect UWP Circle Button Style
<Style x:Key="CircleButtonStyle" TargetType="Button">
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}"/>
<Setter Property="Padding" Value="8,4,8,4"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
<Setter Property="FontWeight" Value="Normal"/>
@kskhannaio
kskhannaio / FAB.xaml
Created February 22, 2021 06:15 — forked from colinkiama/FAB.xaml
UWP Material Floating Action Button Style (Requires Windows Community Toolkit)
<!--Include this somewhere-->
<!--xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"-->
...
<Style x:Key="CircleButtonStyle" TargetType="Button">
<Setter Property="Background" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}"/>
<Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundTransparentBrush}"/>
<Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}"/>
<Setter Property="Padding" Value="8,4,8,4"/>
@kskhannaio
kskhannaio / tmux.conf
Created December 4, 2020 07:45 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@kskhannaio
kskhannaio / json.lua
Created August 24, 2020 10:09 — forked from tylerneylon/json.lua
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.
@kskhannaio
kskhannaio / swap_django_auth_user.md
Last active January 4, 2018 13:03 — forked from vladiibine/swap_django_auth_user.md
Swap django auth.User with custom model after having applied the 0001_initial migration

Swapping the django user model during the lifecycle of a project (django 1.8 guide)

I've come to a point where I had to swap django's user model with a custom one, at a point when I already had users, and already had apps depending on the model. Therefore this guide is trying to provide the support that is not found in the django docs.

Django warns that this should only be done basically at the start of a project, so that the initial migration of an app includes the creation of the custom user model. It took a while to do, and I ran into problems created by the already existing relations between other models and auth.User.

There were good and not so good things regarding my project state, that influenced the difficulty of the job.

Things that made the swap simpler
  1. My custom user also had an id field, that's just a usual default django id