Skip to content

Instantly share code, notes, and snippets.

View ryanwebjackson's full-sized avatar

Ryan Jackson ryanwebjackson

View GitHub Profile
# Change PowerShell terminal windows title.
$host.ui.RawUI.WindowTitle = "Changed Title"
@ryanwebjackson
ryanwebjackson / LookedUpGitCommands.txt
Created October 3, 2017 01:09
Git commands I find myself looking up (in 2017)
# Remove untracked files, forced, including directories.
git clean -fd
# Compare files that have been changed, and staged for commit.
git diff --cached
//This only run testA
describe('Spec1', function () {
// Method is 'fit' "Focus it" in Jasmine version 2.
iit('testA', function () {
...
});
it('testB', function () {
...
public class ProtectAgainstCookiePoisoning
{
public static void Main()
{
SessionIDManager manager = new SessionIDManager();
string newSessionID = manager.CreateSessionID(Context);
manager.SaveSessionID(Context, newSessionID, out redirected, out isAdded);
}
}
'use strict';
var express = require('express');
var router = express.Router();
var ConnectWiseRest = require('connectwise-rest');
router.get('/cwapi', function (req, res) {
//debugger;
using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
var noopList = new List<string>(0);
noopList.Add("an item");
Console.WriteLine(noopList[0]);
(function(thing, doAdditionalStuff) {
var originalMethod = thing.method;
thing.method = function() {
doAdditionalStuff();
return originalMethod.apply(this, arguments);
};
})(thingObject, doAdditionalStuffFunction);
//Calling out dependencies.
var names = new Dictionary<int, string> {
{ 1, "Ryan" },
{ 2, "William" },
{ 3, "Jackson" }
};
$("#files").data("kendoUpload").bind("success", onKUploadSuccess);
function onKUploadSuccess(e) {
$('#GridName').data('kendoGrid').dataSource.read();
$('#GridName').data('kendoGrid').refresh();
}