Skip to content

Instantly share code, notes, and snippets.

View StefH's full-sized avatar

Stef Heyenrath StefH

View GitHub Profile
private static void MemoryStreamTest()
{
string localFilePath = @"c:\tmp";
try
{
using (MemoryStream memoryStream = new MemoryStream())
{
for (int i = 0; i< 256;i++)
{
@jakubsuchybio
jakubsuchybio / data.csproj
Last active November 4, 2020 21:40
csproj additional folders copy
<ItemGroup>
<DataFiles Include="$(ProjectDir)Data\**\*.*" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Copy SourceFiles="@(DataFiles)" DestinationFiles="@(DataFiles->'$(TargetDir)Data\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
</Target>
<Target Name="AddPayloadsFolder" AfterTargets="Publish">
<Copy SourceFiles="@(DataFiles)" DestinationFiles="@(DataFiles->'$(PublishDir)Data\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
@4M01
4M01 / PrivateBrowsing.java
Last active October 16, 2019 12:31
Open Firefox Browser in Incognito Mode using Selenium WebDriver
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
/**
* Created by Amol Chavan on 9/19/2016.
*/
public class PrivateBrowsing {
public static void main(String args[]){
@rupzme
rupzme / SoapUI Groovy Script JSONPath Example
Created October 19, 2015 14:25
SoapUI JSONPath Groovy Script Example Example
import static com.jayway.jsonpath.JsonPath.parse
def json = '''{"quote": {
"id": 12345,
"am ount": 100,
"links": [
{
"rel": "self",
"href": "http://localhost:8080/quote/777"
},
@davask
davask / htmlEncode.js
Last active May 19, 2020 18:26
Name : htmlEncode("text"), htmlDecode("text") - Language : JavaScript, jQuery - type : function - platform : generic
// http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding?answertab=votes#tab-top
function htmlEncode(value){
"use strict";
//create a in-memory div, set it's inner text(which jQuery automatically encodes)
//then grab the encoded contents back out. The div never exists on the page.
return $('<div/>').text(value).html();
}
function htmlDecode(value){
"use strict";