Skip to content

Instantly share code, notes, and snippets.

@ryancole
ryancole / foo.css
Created October 30, 2019 00:30
use bootstrap to create fillable content divs
#parent {
height: 300px;
}
# https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
while (1) {
$duration = Get-Random -Minimum 10 -Maximum 60
Write-Output "Waiting $duration seconds ...";
Start-Sleep -Seconds $duration
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
#include "ShooterGame.h"
#include "Weapons/ShooterWeapon.h"
#include "Weapons/ShooterDamageType.h"
#include "UI/ShooterHUD.h"
#include "Online/ShooterPlayerState.h"
#include "Animation/AnimMontage.h"
#include "Animation/AnimInstance.h"
#include "Sound/SoundNodeLocalPlayer.h"
var html = new HtmlDocument();
// load the document's html
html.LoadHtml(document.Html);
// create a string of the text only
document.Text = Regex.Replace(string.Join(" ", html.DocumentNode.SelectNodes("//text()").Select(m => m.InnerText)), @"\s+", " ").Trim();
WITH RankedMonthlySizes AS
(
SELECT Matter_MatterId AS MatterId,
HostingFilesize,
DENSE_RANK() OVER (PARTITION BY Matter_MatterId ORDER BY MonthAndYear DESC) AS DateRank
FROM dbo.RelativityMatterFilesizes
)
SELECT s.MatterId, s.HostingFilesize
FROM RankedMonthlySizes AS s
JOIN dbo.Matters AS m ON m.MatterId = s.MatterId
host=prod.na2.lol.riotgames.com
xmpp_server_url=chat.na2.lol.riotgames.com
ladderURL=http://www.leagueoflegends.com/ladders
storyPageURL=http://www.leagueoflegends.com/story
lq_uri=https://lq.na2.lol.riotgames.com
ekg_uri=https://ekg.riotgames.com
regionTag=na
rssStatusURLs=null
lobbyLandingURL=http://landing.leagueoflegends.co.kr/
loadModuleChampionDetail=true
(ns replays.handler
(:require [compojure.core :refer [GET defroutes]]
[compojure.route :as route]
[ring.util.response :refer [response resource-response]]
[ring.middleware.json :as json]
[ring.middleware.defaults :refer [wrap-defaults api-defaults]]))
(defroutes app-routes
(GET "/" [] (resource-response "index.html" {:root "public"}))
(GET "/widgets" [] (response [{:name "Widget 1"} {:name "Widget 2"}]))
@ryancole
ryancole / regex.cs
Created March 10, 2015 22:27
RegExWoo
using System;
using System.Text.RegularExpressions;
namespace RegExWoo
{
class Program
{
static void Main(string[] args)
{
var text = "701 N.Y.S.2d 766, 123 N.Y.S.2d 256 (N.Y.City Civ.Ct. 1999), McEntee v Cappucci";
-- original query without the aggregation
SELECT o.OpinionDocumentId,
o.DisplayTitle,
o.Date
FROM dbo.OpinionDocumentOpinionDocuments c
JOIN dbo.OpinionDocuments o ON o.OpinionDocumentId = c.OpinionDocument_OpinionDocumentId
WHERE c.OpinionDocument_OpinionDocumentId1 = 617143
-- adjusted query with aggregation sub-query
-- can this query be improved?
@ryancole
ryancole / factorial.js
Created September 25, 2014 03:36
factorial
function factorial (n) {
return n <= 1 ? 1 : n * factorial(n - 1);
};
var factorial_memo = (function () {
var memo = [1];
function fac (n) {
var result = memo[n];
if (typeof result !== 'number') {