Skip to content

Instantly share code, notes, and snippets.

View morbidcamel101's full-sized avatar
🎯
Focusing

MorbidCamel morbidcamel101

🎯
Focusing
View GitHub Profile
@morbidcamel101
morbidcamel101 / ISO3166-1.alpha2.json
Created August 4, 2020 22:16 — forked from ssskip/ISO3166-1.alpha2.json
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
;WITH CTE AS(
SELECT field_to_identify_duplicate,
RN = ROW_NUMBER()OVER(PARTITION BY field_to_identify_duplicate ORDER BY field_to_identify_duplicate)
FROM table_with_duplicates
)
DELETE FROM CTE WHERE RN > 1
@morbidcamel101
morbidcamel101 / MoveCamera.cs
Created January 14, 2018 21:29 — forked from JISyed/MoveCamera.cs
Camera movement script in Unity3D. Supports rotating, panning, and zooming. Attach to the main camera. Tutorial explaining code: http://jibransyed.wordpress.com/2013/02/22/rotating-panning-and-zooming-a-camera-in-unity/
// Credit to damien_oconnell from http://forum.unity3d.com/threads/39513-Click-drag-camera-movement
// for using the mouse displacement for calculating the amount of camera movement and panning code.
using UnityEngine;
using System.Collections;
public class MoveCamera : MonoBehaviour
{
//
// VARIABLES
@morbidcamel101
morbidcamel101 / urlobject.js
Created February 22, 2017 15:05 — forked from aymanfarhat/urlobject.js
JS utility function that: - Breaks down url to an object with accessible properties: protocol, parameters object, host, hash, etc... - Converts url parameters to key/value pairs - Convert parameter numeric values to their base types instead of strings - Store multiple values of a parameter in an array - Unescape parameter values
function urlObject(options) {
"use strict";
/*global window, document*/
var url_search_arr,
option_key,
i,
urlObj,
get_param,
key,

Execute the following script using your MyGet [feedUrl] and MyGet [username] , [password] and [apikey]. Run this from a commandline where you have access to nuget.exe (or set the path to your nuget.exe in a system environment variable).

Store credentials in machine-level nuget.config (non-transferable)

nuget setapikey [apikey] -source [feedUrl]
nuget sources add -Name [name] -source [feedUrl] -User [username] -pass [password]
@morbidcamel101
morbidcamel101 / CrossOriginSupportModule.cs
Created November 23, 2015 16:53 — forked from mmorton/CrossOriginSupportModule.cs
An IHttpModule for Enabling CORS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Sample
{
public class CrossOriginRequestInfo
{
public string Origin { get; set; }
public class PdfFilter : Stream
{
private readonly Stream _oldFilter;
private readonly string _baseUrl;
private readonly MemoryStream _memStream;
public override bool CanSeek
{
get { return false; }
}