Skip to content

Instantly share code, notes, and snippets.

View milosh-96's full-sized avatar

Miloš Jovanović milosh-96

View GitHub Profile
@milosh-96
milosh-96 / asp-net-3.1-identity-mysql-migration.cs
Created June 11, 2022 23:22
The main purpose of this is that I adjusted lengths so you don't get errors like "specified key is too long".
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using MySql.EntityFrameworkCore.Metadata;
namespace AspNetProject.Data.Migrations
{
public partial class Identity : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
#1 Resetting work
git pull origin dev // ensure you have latest code from the remote repo (unless you want to do something with old code)
git status // ensure you commited all changes
git reset --hard // this will reset code to the last commit
git reset --hard <commit id> // this will reset code to specific commit
git pull origin dev // just confirm everything is up-to-date.
git status // ensure there are not unstaged files something like that
.w-25 {
width: 25% !important;
}
.w-50 {
width: 50% !important;
}
.w-75 {
import xml.etree.ElementTree as ET
import urllib
xml = urllib.urlopen("https://www.w3schools.com/xml/books.xml")
tree = ET.parse(xml)
root = tree.getroot()
cat = raw_input('Kategorija: ')
for child in root:
@milosh-96
milosh-96 / character-input
Created June 23, 2015 13:18
Character Input
import datetime
name = raw_input("Enter your name")
years = raw_input("How old are you?")
try:
years = int(years);
print "Your name is",name,", 100 years you will have on a", (datetime.date.today().year - years) + 100," year"
except:
print "broj godina mora biti unet BROJEVIMA, ne slovima."