This is just how Nim compilation to C looks like in Windows.
View replace-static-page-content.js
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() { | |
if (fetch && Promise && document.querySelector && history) { // <-- Dependencies. Otherwise normal links will remain. | |
function loadPage(url) { | |
fetch(url).then(function (res) { | |
return res.text(); | |
}).then(function(html) { | |
var dom = new DOMParser().parseFromString(html, 'text/html'); | |
var title = dom.querySelector('title').innerText; | |
history.pushState({}, title, url); | |
document.title = title; |
View simple-html-tokeniser.js
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
`<div> | |
Some text here | |
<div> | |
<h3>Lorem <a href="./abc/def.html">ipsum</a></h3> | |
<p>Dolor sit</p> | |
<p>amet</p> | |
</div>` | |
.split(/([<>\s="\/]{1})/g) | |
.map(s=>s.trim()) | |
.filter(Boolean) |
View index.html
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<x-one></x-one> | |
<script src="./x-one.js"></script> | |
</body> | |
</html> |
View index.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<x-one> | |
<p>Lorem ipsum</p> | |
Dolor sit amet | |
</x-one> |
View simple-csharp-parser.py
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
lines = ''' | |
using Abc.Def; | |
namespace Abc.Hijk | |
{ | |
public class Haha: ILaugh | |
{ | |
public Haha() | |
{ | |
// Constructor |
View TestOne.cs
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
using Abc; | |
public class One | |
{ | |
public void Foo() | |
{ | |
// macro: set ClassName // Changes the assigned default or any value in the line below | |
string className = default; | |
Console.WriteLine(className + " Foo"); |
View csharp-code-replace-eg.py
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
## // e.g. | |
## MBOverlay mbOverlay = UIUtil.GetBusyOverlay(AppStrings.LoadRevision); | |
## --> VML.LoaderViewModel.Add($"DoorSideBar-{AppStrings.LoadRevision}", Models.ActivityType.API, message: AppStrings.LoadRevision, activitySeverity: Models.ActivitySeverity.High); | |
## mbOverlay.Hide(); | |
## --> VML.LoaderViewModel.Remove($"DoorSideBar-{AppStrings.LoadRevision}"); | |
## // AppStrings.LoadRevision, Properties..., "", messages: List<string> | |
import os, re | |
# files = [f for f in os.listdir('.') if os.path.isfile(f)] |
View git-clearHistory.sh
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
# Remove the history from | |
rm -rf .git | |
# recreate the repos from the current content only | |
git init | |
git add . | |
git commit -m "Initial commit" | |
# push to the github remote repos ensuring you overwrite history | |
git remote add origin git@github.com:<account>/<repo>.git |
View flags.cs
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
// Each account on a website has a set of access flags that represent a user's access. | |
// | |
// Update and extend the enum so that it contains three new access flags: | |
// | |
// [Flags] | |
// public enum Access | |
// { | |
// Delete = 1, | |
// Publish = 2, | |
// Submit = 3, |
NewerOlder