This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get all fields marked as Primary Key | |
var keyFields = type.GetProperties() | |
.Where(prop => prop.GetCustomAttributes(typeof(KeyAttribute), true).Any()) | |
.Select(prop => prop.Name) | |
.ToList(); | |
//Get all fields that end with Id and Not marked as Foreign Key | |
keyFields.AddRange(type.GetProperties() | |
.Where(prop => | |
prop.Name.EndsWith("Id", true, CultureInfo.InvariantCulture) | |
&& !prop.GetCustomAttributes(typeof(ForeignKeyAttribute), true).Any() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!TEX TS-program = xelatex | |
\documentclass[24pt]{letter} | |
\usepackage{xeCJK} | |
\usepackage{ruby} | |
\setCJKmainfont{Hiragino Kaku Gothic ProN} | |
\usepackage{setspace} | |
%\doublespace | |
% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(console) | |
{ | |
"use strict"; | |
var nop = function() {}; | |
var ops = ["log", "info", "error", "warn", "time", "timeEnd", "group", "groupEnd", "timeline", "timelineEnd", "timeStamp"]; | |
for(var x = 0; x < ops.length; x++) | |
{ | |
if(!console[ops[x]]) { console[ops[x]] = nop; } | |
} | |
}(window.console = window.console || { $replaced: true })); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name NewEgg Price in Bitcoin | |
// @namespace gist.github.com/vsviridov/ | |
// @description Display the grand total of your shopping cart in BTC | |
// @include *//secure.newegg.ca/Shopping/ShoppingCart.aspx* | |
// @include *//secure.newegg.com/Shopping/ShoppingCart.aspx* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
container_commands: | |
01_fix_static_cors: | |
command: "/tmp/fix_static_cors.sh" | |
files: | |
"/tmp/fix_static_cors.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
#!/bin/bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Brand<K, T> = K & { __brand: T }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { Rule } from 'eslint'; | |
import type ESTree from 'estree'; | |
export default { | |
'effector-restore': { | |
meta: { | |
docs: { | |
description: 'Replace simple store setting with restore', | |
category: 'Suggestions', | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import socket # Just so we can properly handle hostname exceptions | |
import obspython as obs | |
import paho.mqtt.client as mqtt | |
import ssl | |
import pathlib | |
import time | |
import enum | |
import uuid | |
from multiprocessing import Lock |