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
public class AutofacModule:Module | |
{ | |
private static readonly object[] NoParameters = new object[] { }; | |
protected override void Load(ContainerBuilder builder) | |
{ | |
var dbsetType = typeof(DbSet<>); | |
var registerMethod = new Func<ContainerBuilder, Func<IComponentContext, object>, IRegistrationBuilder<object, SimpleActivatorData, SingleRegistrationStyle>>(Af.RegistrationExtensions.Register<object>) | |
.Method.GetGenericMethodDefinition(); | |
foreach (var property in typeof(ApplicationDbContext).GetProperties()) |
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
#!/usr/bin/env python | |
from datetime import datetime | |
from functools import wraps | |
from hashlib import sha1 | |
from time import sleep | |
import os | |
import pymssql | |
import click | |
from sty import fg, rs |
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
// Calculates the price per click per second taking into account synergies. | |
function potato() { | |
const result = {} | |
for (const me of Object.values(Game.Objects).sort((a,b) => a.id - b.id)) { | |
let synergyBoost = 0 | |
if (me.name=='Grandma') | |
{ | |
for (var i in Game.GrandmaSynergies) | |
{ |
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
use std::rc::Rc; | |
use rusqlite::{params, Connection, Statement}; | |
use owning_ref::OwningHandle; | |
struct MyStatements<'a> { | |
select_all: Statement<'a>, | |
select_one: Statement<'a> | |
} | |
type MyStatementsOwned = OwningHandle<Rc<Connection>, Box<MyStatements<'static>>>; |
OlderNewer