Skip to content

Instantly share code, notes, and snippets.

@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active July 17, 2025 02:58
Vanilla JavaScript Quick Reference / Cheatsheet
@markryd
markryd / nancy-linqpad.cs
Created March 7, 2016 00:39
Run Nancy in Linqpad
// nuget in Nancy and Nancy.Hosting.Self
void Main()
{
using (var host = new Nancy.Hosting.Self.NancyHost(new Uri("http://localhost:8080"), new LinqpadNancyBootstrapper()))
{
host.Start();
Console.ReadLine();
}
}
@esfand
esfand / introrx.md
Last active May 15, 2016 18:37 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@devinmancuso
devinmancuso / Chromium Mobile Device List
Created December 3, 2014 06:01
Mobile Device Emulation List from Chromium
#Pulled from Chromium at: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/devtools/front_end/toolbox/OverridesUI.js&q=WebInspector.OverridesUI._phones%20file:OverridesUI.js&sq=package:chromium&type=cs&l=310
#Phones
Define_phones = [
{deviceName: "Apple iPhone 3GS", width: 320, height: 480, deviceScaleFactor: 1, userAgent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", touch: true, mobile: true},
{deviceName: "Apple iPhone 4", width: 320, height: 480, deviceScaleFactor: 2, userAgent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", touch: true, mobile: true},
{deviceName: "Apple iPhone 5", width: 320, height: 568, deviceScaleFactor: 2, userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Versi
@stenver
stenver / gist:337aea741fe7d70ce703
Created September 9, 2014 17:01
How to set up windows machine for selenium and jenkins
# Setting up internet explorer machine with selenium
Download the machine with appropriate windows and IE from microsoft
https://www.modern.ie/en-us/virtualization-tools
Boot it up with GUI
Disable UAC and firewall - its an isolated machine that noone will access anyway(and if they do, theres really nothing there), so why bother
# Copssh
@joey-qc
joey-qc / TSQL-to-POCO
Created September 26, 2013 06:56
A simple TSQL script to quickly generate c# POCO classes from SQL Server tables and views. You may tweak the output as needed. Not all datatypes are represented but this should save a bunch of boilerplate coding. USAGE: Run this query against the database of your choice. The script will loop through tables, views and their respective columns. Re…
declare @tableName varchar(200)
declare @columnName varchar(200)
declare @nullable varchar(50)
declare @datatype varchar(50)
declare @maxlen int
declare @sType varchar(50)
declare @sProperty varchar(200)
DECLARE table_cursor CURSOR FOR
@theorigin
theorigin / CsvParse.vb
Created July 30, 2013 15:08
Parse CSV using Microsoft.VisualBasic.FileIO.TextFieldParser
Using MyReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser("C:\testfile.txt")
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(",")
Dim currentRow As String()
While Not MyReader.EndOfData
Try
currentRow = MyReader.ReadFields()
Dim currentField As String
For Each currentField In currentRow
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@theorigin
theorigin / merge_lookups.sql
Created July 23, 2012 07:42
SQL Server MERGE statement
MERGE INTO Lookups AS Target
USING (VALUES
(0, N'Lookup Number 0'),
(1, N'Lookup Number 1'),
(2, N'Lookup Number 2'),
(3, N'Lookup Number 3'),
(4, N'Lookup Number 4'),
(5, N'Lookup Number 5'),
(6, N'Lookup Number 6')
)
@PalmerEk
PalmerEk / dotNetPassHash
Last active June 28, 2025 03:43
ASP.NET Membership password hash for Node.js
See updated reply by OpenSpacesAndPlaces
https://gist.github.com/PalmerEk/1191651?permalink_comment_id=4449026#gistcomment-4449026
/////////////////////////////////////////////////////////////
// ORIGINAL/OLD for posterity
/////////////////////////////////////////////////////////////
var crypto = require('crypto');
console.log(dotnet_membership_password_hash("welcome1", "qkI2wRPSW7Y4ArqWkfHm5g==")); // W25/z6MAywBax7DITuKgSmsXua4=