Instantly share code, notes, and snippets.

View ballot.sol
pragma solidity ^0.4.0;
// import ""
contract Test {
int a =10;
int b = 15;
function add(a, b )public constant returns(int) {
return a+b;
View modernWebpartToWikiPage.ps1
onnect-PnPOnline "https://tenant.sharepoint.com/sites/Test"
$webpartXML = [IO.File]::ReadAllText("C:\Users\Admin\Desktop\peopleModernWebpart.dwp")
Add-PnPWebPartToWikiPage -ServerRelativePageUrl "/sites/Test/Pages/TestPage.aspx" -Xml $webpartXML -Row 1 -Column 1
View webpack.config.js
module.exports = {
node: {
crypto: true,
path: true,
os: true,
stream: true,
}
}
View regex.reinoso
/A./
/[0-9]{2}[/][0-9]{2}[/][0-9]{4}/
/[8-9]{1}[/][0-9]{2}/
/[a-z]{14,}/gi
/\bhttps:\/\/(w{3}\.)?[\w.-]+\.[\w]{2,5}\b/
View mvc_enterprise_stack.cs
void Main()
{
//Autofac Configuration
var builder = new Autofac.ContainerBuilder();
builder.RegisterModule(new ApplicationContainerBuilderModule());
builder.RegisterModule(new ServiceContainerBuilderModule());
var container = builder.Build();
using (var scope = container.BeginLifetimeScope())
{
View callByName.scala
def fix[A](f: A => A): A = f(fix(f))
def fib(n: Int) = fix[Int => Int]( recur => n =>
if (n <= 1) 1
else recur(n - 1) + recur(n - 2))
View bip_output.pcode
Local string &path;
SQLExec("SELECT PRCSOUTPUTDIR FROM PS_CDM_LIST WHERE PRCSINSTANCE = :1", &processInstance, &path);
%This.ReportDefn.OutDestination = &path;
%This.ReportDefn.ProcessReport(%This.TemplateId, %Language_User, %Date, %This.OutputFormat);
/* publish */
If %OutDestType = 6 Then /* Web */
%This.ReportDefn.Publish("", "", "", &processInstance);
Else;
If %OutDestType = 3 Then /* Printer */
%This.ReportDefn.PrintOutput(%FilePath);
View typescriptMissing.ts
class A {
constructor(); // Error: overload signature not compatible with impl
constructor(a: number | undefined) {}
}
class A {
constructor();
constructor(a?: number) {} // this one works
}
View index.html
<div class="container">
<svg class="rocket-svg" version="1.1" x="0px" y="0px" width="600px" height="600px" viewBox="0 0 600 600" >
<defs>
<clipPath id="clipPath">
<circle id="rocketMask" cx="300" cy="300" r="80" />
</clipPath>
<symbol id="rocket-symbol">
<path fill="#C63121" d="M361.2,305.8c-0.4,28.4-5.3,59.2-14.7,92.3c30,16.6,51.4,26,64.1,27.9C409.5,388,393,347.9,361.2,305.8"/>
<path fill="#C63121" d="M252.4,398.2c-9.4-33.2-14.2-64-14.7-92.3c-31.8,42-48.3,82.1-49.4,120.3C201,424.2,222.3,414.8,252.4,398.2