Skip to content

Instantly share code, notes, and snippets.

View uzbekdev1's full-sized avatar
🌴
On vacation

Elyor Latipov uzbekdev1

🌴
On vacation
View GitHub Profile
@lionofdezert
lionofdezert / CasecadeDelete.sql
Created August 2, 2012 19:38
Casecade Delete in SQL Server
USE AdventureWorks
GO
--============== Supporting function dbo.udfGetFullQualName
IF OBJECT_ID('dbo.udfGetFullQualName') IS NOT NULL
DROP FUNCTION dbo.udfGetFullQualName
GO
CREATE FUNCTION dbo.udfGetFullQualName ( @ObjectId INTEGER )
@rippinrobr
rippinrobr / gist:3241701
Created August 2, 2012 23:04
updated app.config file to add Npgsql as a data provider for this app.
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<connectionStrings>
<add name="hockeydb"
connectionString="Server=127.0.0.1;Port=5432;Database=hockeydb;User Id=demo;Password=demo;"
providerName="Npgsql"
/>
</connectionStrings>
<system.data>
@gin1314
gin1314 / test.c
Created August 23, 2012 08:54
C++ : Win32 API InternetOpen example
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <winsock.h>
#include <wininet.h>
#include <shellapi.h>
#include <mmsystem.h>
typedef struct vs {
char host[128];
@lancejpollard
lancejpollard / cursor-position.js
Created September 22, 2012 07:24
Get Cursor Position in Terminal with Node.js
module.exports = function(callback) {
require('child_process').exec('./cursor-position.sh', function(error, stdout, stderr) {
callback(error, JSON.parse(stdout));
});
}
@mxpv
mxpv / ProcessUtil.cs
Created September 28, 2012 09:31
Process start helper utility with CancellationToken and async output reading support
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Threading;
using Microsoft.Win32.SafeHandles;
namespace ConsoleApplication
{
public class ProcessUtil : IDisposable
{
@conrjac
conrjac / C#
Created October 16, 2012 10:12
C# Encrypt and Decrypt File - using http://support.microsoft.com/kb/307010
using System;
using System.IO;
using System.Security;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using System.Text;
namespace CSEncryptDecrypt
{
class Class1
@lkaczanowski
lkaczanowski / HttpContextCurrentTests.cs
Created November 30, 2012 07:23
Creates HttpContext with Session to stub HttpContext.Current
using System.IO;
using System.Reflection;
using System.Web;
using System.Web.SessionState;
using NUnit.Framework;
namespace Mvc.Tests
{
[TestFixture]
@johnnyreilly
johnnyreilly / CarController.cs
Last active November 6, 2023 22:05
Unit testing ModelState using Moq
using System.Web.Mvc;
namespace MyApp
{
public class CarController : Controller
{
//...
public ActionResult Edit(CarModel model)
{
@jayrambhia
jayrambhia / AndroidMainfest.xml
Created March 28, 2013 19:00
First Android OpenCV Application.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.imgloader"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
@danielkillyevo
danielkillyevo / ObjectComparer.cs
Last active January 30, 2022 15:57
c# object deep comparison
public class ObjectComparer
{
public static bool Equals(object left, object right)
{
//Compare the references
if (object.ReferenceEquals(right, null))
return false;
if (object.ReferenceEquals(left, right))
return true;