Skip to content

Instantly share code, notes, and snippets.

{
"name": "WebpackExample01",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
"keywords": [],
@Kayli
Kayli / ping.ps1
Created September 8, 2017 19:14
PowerShell script to ping a Url with retries and timeouts
param
(
[string] $Url,
[int] $MaxRetries = 3,
[int] $OneRetryTimeout = 5,
[int] $OverallTimeout = 60,
[int] $WaitBetweenRetries = 1
)
if ([System.String]::IsNullOrWhiteSpace($Url))
@Kayli
Kayli / app.config
Last active December 14, 2016 16:00
database query using EF
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="Default" connectionString="Server=localhost;Database=RegoV2;Persist Security Info=True;integrated security=false;User Id=sa; Password=sa;" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
@Kayli
Kayli / gist:4c465ebc8fa636b42015dec58dcd3655
Created July 3, 2016 23:17
2 equivalent methods of adding torque
const float torque = 50f;
//apply torque using joint motor
_hingeJoint1.motor = new JointMotor { freeSpin = true, force = torque, targetVelocity = 999999f };
_hingeJoint1.useMotor = true;
//apply torque using "add torque" method
_cube3Rigidbody.AddTorque(0, 0, torque);
_cube4Rigidbody.AddTorque(0, 0, -torque);
@Kayli
Kayli / gist:5165207
Created March 14, 2013 20:57
Events repository example
public class Repository : DbContextFixed
{
public Event2 AddEvent(object data)
{
return AddEvent(ApplicationStreamId, data);
}
public Event2 AddEvent(Guid streamId, object data)
{
var e = new Event2 {
Created = DateTime.Now,