This file contains 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 MyDbContext : DbContext | |
{ | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ | |
optionsBuilder.UseSqlServer(connectionString); | |
optionsBuilder.ReplaceService<IQuerySqlGeneratorFactory, WithNolockQuerySqlGeneratorFactory>(); | |
base.OnConfiguring(optionsBuilder); | |
} |
This file contains 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
string secret = "[shopify-multipass-secret]"; | |
string store = "[shopify-store]"; | |
var json = System.Text.Json.JsonSerializer.Serialize(new { | |
email = "[customer-email]", | |
created_at = DateTime.Now.ToString("O"), | |
identifier = "[customer-uid]", | |
//remote_ip = "" | |
}); | |
var hash = System.Security.Cryptography.SHA256.Create().ComputeHash(Encoding.UTF8.GetBytes(secret)); |
This file contains 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 evaluate(code, args = {}) { | |
// Call is used to define where "this" within the evaluated code should reference. | |
// eval does not accept the likes of eval.call(...) or eval.apply(...) and cannot | |
// be an arrow function | |
return function evaluateEval() { | |
// Create an args definition list e.g. "arg1 = this.arg1, arg2 = this.arg2" | |
const argsStr = Object.keys(args) | |
.map(key => `${key} = this.${key}`) | |
.join(','); | |
const argsDef = argsStr ? `let ${argsStr};` : ''; |
This file contains 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
/** | |
* Copyright 2014 Ricky Tobing | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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
package net.frakbot.gists.widgethelper; | |
/* | |
* Copyright 2014 Sebastiano Poggi | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
This file contains 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
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification | |
apply plugin: 'android' | |
targetCompatibility = 1.6 | |
sourceCompatibility = 1.6 | |
android { | |
target = 'android-14' |
This file contains 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
var stringify = function(obj, prop) { | |
var placeholder = '____PLACEHOLDER____'; | |
var fns = []; | |
var json = JSON.stringify(obj, function(key, value) { | |
if (typeof value === 'function') { | |
fns.push(value); | |
return placeholder; | |
} | |
return value; | |
}, 2); |