Skip to content

Instantly share code, notes, and snippets.

View lazzyms's full-sized avatar
👨‍💻

Maulik Sompura lazzyms

👨‍💻
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
<UserControl x:Class="TestApp.mainUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SaiData.TestApp"
mc:Ignorable="d"
>
<Grid>
<Grid.ColumnDefinitions>
@lazzyms
lazzyms / copy.js
Created July 24, 2018 13:19
copy the built project to another folder.
const fs = require('fs-extra')
var del = require("delete");
//delete js
console.log("Deleting Old JS");
del.sync('../electron/main.*.js', {
force: true
});
console.log("Deleted");
@lazzyms
lazzyms / mysql.js
Created July 24, 2018 13:05
Node.js code to connect to mysql
var http = require("http");
var mysql = require("mysql");
var fs = require("fs");
var jsonContent = null;
const prompt = require('electron-prompt');
var userdata = {
"host": '',
"port": '',
"username": '',
"password": '',
@lazzyms
lazzyms / main.js
Created July 24, 2018 12:51
electron main.js
const setupEvents = require('./installers/setupEvents')
if (setupEvents.handleSquirrelEvent()) {
// squirrel event handled and app will exit in 1000ms, so don't do anything else
return;
}
const {
app,
BrowserWindow,
ipcMain
} = require('electron')
@lazzyms
lazzyms / drop_table.sql
Last active March 1, 2018 06:49
Getting all the table name of the database and generating a Drop table query.
SET FOREIGN_KEY_CHECKS = 0;
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables
FROM information_schema.tables
WHERE table_schema = 'DBNAME' and table_type = 'Base Table';
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET FOREIGN_KEY_CHECKS = 1;