Skip to content

Instantly share code, notes, and snippets.

@jeriley
jeriley / package.json
Created Apr 29, 2020
.net core 3 with angular 9 (updated from 8)
View package.json
{
"name": "core_angular",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build:ssr": "ng run Core_Angular:server:dev",
"test": "ng test",
"lint": "ng lint",
View DataTest.java
@RunWith(MockitoJunitRunner.class)
//@ContextConfiguration({"/stuff.xml"})
public class SomeDaoTest {
@Mock
private SessionFactory factory;
@Mock
private Session session;
View .bashrc
function open {
explorer .
}
function reset-me {
echo 'resting HEAD'
git fetch origin
git reset --hard origin/master
}
View CollapsedExample.cs
using Moq;
using NUnit.Framework;
using Should;
//and some other stuff
namespace WorkerTests
{
[TestFixture]
public class Worker_CreateThingFromContractTests
{
View keybase.txt
### Keybase proof
I hereby claim:
* I am jeriley on github.
* I am jeriley (https://keybase.io/jeriley) on keybase.
* I have a public key whose fingerprint is B38D 868C 4219 D39A 2090 E6EA 57F3 D2D9 5A72 BDC0
To claim this, I am signing this object:
@jeriley
jeriley / SalesforceChecksum.ts
Created Feb 20, 2018
Salesforce ID checksum ... now in typescript!
View SalesforceChecksum.ts
export class SalesforceChecksum
{
private lookup = {};
private checksumChars = Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345");
constructor()
{
for (var i = 0; i < 32; i++)
{
let value = (i >>> 0).toString(2);
@jeriley
jeriley / Checksum.cs
Created Feb 28, 2017
Salesforce ID checksum in C#
View Checksum.cs
public class Checksum
{
private Dictionary<string, char> _lookup = new Dictionary<string, char>();
private char[] _checksumChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ012345".ToCharArray();
public Checksum()
{
for (var i = 0; i < 32; i++)
{
var bit = Convert.ToString(i, 2).PadLeft(5, '0');
View jasmine-jquery-post-example.js
function buildIt($){
this.postIt = function(itemToChange){
$.post('giggle', function(data){
itemToChange.item = data.item;
});
}
};
@jeriley
jeriley / spark.bat
Created Feb 2, 2016
setting up Spark shortcut / reminders (windows)
View spark.bat
@echo do you have winutils or hadoop_home?
mkdir C:\tmp\hive
%HADOOP_HOME%\bin\winutils chmod 777 /tmp/hive
@echo does your path have a thing for spark?
cd C:\
spark-shell
@jeriley
jeriley / DbContextMockExtension.cs
Created Mar 23, 2015
DbContext Mocking example
View DbContextMockExtension.cs
namespace Moq.Context {
public static class DbContextMockExtension
{
public static Mock<AHContext> SetupPartOfTheContextWith<T>(this Mock<AHContext> mockContext, List<T> listOfT, Expression<Func<AHContext, DbSet<T>>> setupReturn) where T : BaseEntity
{
var queryable = listOfT.AsQueryable();
var mockSet = new Mock<DbSet<T>>();
You can’t perform that action at this time.