Skip to content

Instantly share code, notes, and snippets.

function fieldAddedCallback(field, element) {
if(element.hasClass("block-emoji-pattern")) {
$(element).find("input").on("keypress paste input keydown", function(event) {
var val = $(this).val();
@bgilbert6
bgilbert6 / CustomCookieManager.cs
Last active May 23, 2020 21:46
Per Browser Tab Dotnet Core Cookie Authentication
public class CustomCookieManager : ICookieManager
{
private const string CookieTabContext = "X-Shop-Name";
private readonly ChunkingCookieManager _innerCookieManager = new ChunkingCookieManager();
public void AppendResponseCookie(HttpContext context, string key, string value, CookieOptions options)
{
key = GetTabContext(context) + key;
{
"matchid":"m56",
"num_maps":1,
"players_per_team":5,
"min_players_to_ready":5,
"min_spectators_to_ready":0,
"skip_veto":false,
"veto_first":"team1",
"side_type":"standard",
"spectators":{
{
"matchid": "576576",
"num_maps": 3,
"players_per_team": 1,
"min_players_to_ready": 1,
"min_spectators_to_ready": 0,
"skip_veto": false,
"veto_first": "team1",
"side_type": "standard",
@bgilbert6
bgilbert6 / ExampleHub.cs
Last active April 22, 2020 22:23
SignalR RPC wrapper for server calls
public class ExampleHub : Hub
{
private readonly IServiceProvider provider;
public Dictionary<string, Type> RpcMethods = new Dictionary<string, Type>();
private Dictionary<Type, IWebSocketRpc> RpcInstances = new Dictionary<Type, IWebSocketRpc>();
public ExampleHub(IServiceProvider provider)
{
this.provider = provider;
import { Directive, Input, Renderer2, ElementRef, ViewChild } from '@angular/core';
@Directive({
selector: '[btnLoading]'
})
export class BtnLoadingDirective {
@Input()
set btnLoading(condition: boolean) {
@bgilbert6
bgilbert6 / CollideableEllipsoid.java
Created October 15, 2016 17:00
Simple Ellipsoid Collideable
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mygame;
import com.jme3.math.FastMath;
import com.jme3.math.Plane;
import com.jme3.math.Ray;
import com.jme3.math.Triangle;
Imports Microsoft.VisualBasic
Public Class LargeModalWindow
Inherits BaseModal
Public Property HeadingTitle As String = ""
Public Property DataID As String
Get
Dim o As Object = ViewState("DataID")
public void render() {
boolean firstPass = true;
for(MapLight light : mapLightRenderer.lights) {
batch.setShader(mapLightRenderer.lightShader);
lightFBO.begin();
batch.setProjectionMatrix(cam.combined);
batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
Gdx.gl.glClearColor(1f,0f,0f,0f);