Skip to content

Instantly share code, notes, and snippets.

View tayyebi's full-sized avatar
📿
Grateful

MohammadReza Tayyebi tayyebi

📿
Grateful
View GitHub Profile
@tayyebi
tayyebi / sqlInstances.txt
Created March 25, 2017 13:46
Get SQL instances
Just open cmd as admin and:
for localdb:
sqllocaldb i
for express and other instances:
OSQL -L
@tayyebi
tayyebi / HomeController.cs
Last active March 30, 2017 18:48
count down with matrix
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
## You could try to open the terminal,
## then
> sudo gedit /etc/default/grub
## and in the line that says:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
## change it for:
@tayyebi
tayyebi / telegram.sh
Created April 4, 2017 18:18
Set permission to user in order to own everything in a directory
#!/bin/bash
sudo chown $(id -u):$(id -g) -R /home/rexa/.local/share/TelegramDesktop/*
declare @TableName sysname = 'Charity'
declare @Result varchar(max) = 'public class ' + @TableName + '
{'
select @Result = @Result + '
public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; }
'
from
@tayyebi
tayyebi / GenerateRandom.sql
Created June 8, 2017 11:42
Generate Random 10 Char String SQL
select SUBSTRING(Replace(CONVERT(varchar(255), NEWID()), '-', ''), 0, 10)
@tayyebi
tayyebi / G2J.sql
Created July 4, 2017 04:55
Convert Gregorian to Shamsi (Julian)
/*
CopyRight
http://rastan.parsiblog.com/Posts/381/%D8%AA%D8%A8%D8%AF%D9%8A%D9%84+%D8%B3%D8%A7%D8%AF%D9%87+%D8%AA%D8%A7%D8%B1%D9%8A%D8%AE+%D9%85%D9%8A%D9%84%D8%A7%D8%AF%D9%8A+%D8%A8%D9%87+%D8%B4%D9%85%D8%B3%D9%8A+%D8%AF%D8%B1+SQL+Server/
*/
CREATE FUNCTION dbo.[G2J] ( @intDate DATETIME, @Format NVARCHAR(max))
@tayyebi
tayyebi / PersianCalendarDimension.sql
Created July 4, 2017 05:35
Persian calendar dimension
drop function dbo.G2J
drop table DateDimension
drop table #dim
/*
CopyRight
http://rastan.parsiblog.com/Posts/381/%D8%AA%D8%A8%D8%AF%D9%8A%D9%84+%D8%B3%D8%A7%D8%AF%D9%87+%D8%AA%D8%A7%D8%B1%D9%8A%D8%AE+%D9%85%D9%8A%D9%84%D8%A7%D8%AF%D9%8A+%D8%A8%D9%87+%D8%B4%D9%85%D8%B3%D9%8A+%D8%AF%D8%B1+SQL+Server/
@tayyebi
tayyebi / vbox-osx.txt
Created September 4, 2018 08:44
How incept VirtualBox that this machine is Apple iMac; so the you can install OS X Mavericks humble and kind
VBoxManage modifyvm "Mavericks" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "Mavericks" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "Mavericks" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "Mavericks" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "Mavericks" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "Mavericks" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
source https://github.com/osmdroid/osmdroid
@tayyebi
tayyebi / Generate PY from UI
Created February 3, 2019 20:35
Install Qt Designer and Editor Ubuntu
pyuic5 -x file.ui -o output.py