Skip to content

Instantly share code, notes, and snippets.

@krishnathota
krishnathota / Instructions.txt
Created Oct 22, 2021
Delete with Rimraf from context menu
View Instructions.txt
Install the node module rimraf globally
npm i -g rimraf
Copy the delete.bat file into system32
Run the reg file below or follow the below steps
In Regedit go to -> HKEY_CLASSES_ROOT\Directory\shell\
Right-click on Shell and select New > Key
Name the key' Delete with Rimraf'
View Prf.v
(fix W (i : nat) (H : (i < N.to_nat ms)%nat) {struct i} : vector N 64 :=
Vector.map
(λ t : nat,
(if (t <? 64)%nat as tt return ((t <? 64)%nat = tt → N)
then
λ H1 : (t <? 64)%nat = true,
(if (t <? 16)%nat as tb return ((t <? 16)%nat = tb → N)
then
λ H2 : (t <? 16)%nat = true,
byte_vector_to_N
@parrya
parrya / LayoutServicePatch.config
Created Oct 22, 2021
Patch layout service to extend Item Context
View LayoutServicePatch.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<group groupName="layoutService">
<pipelines>
<getLayoutServiceContext>
<processor type="JSSDemo.Feature.Metadata.PipelineProcessors.ItemContext, JSSDemo.Feature.Metadata" />
</getLayoutServiceContext>
</pipelines>
</group>
View ItemContext.cs
using Sitecore.Diagnostics;
using Sitecore.LayoutService.ItemRendering.Pipelines.GetLayoutServiceContext;
using System.Collections.Generic;
using Sitecore;
using Sitecore.Links;
namespace JSSDemo.Feature.Metadata.PipelineProcessors
{
public class ItemContext : IGetLayoutServiceContextProcessor
{
@JonathanWexler
JonathanWexler / coldplay_live_song_freq_by_year.json
Last active Oct 22, 2021
Frequency of Coldplay songs played by year performed
View coldplay_live_song_freq_by_year.json
[
{
"name":"Yellow",
"count":977,
"years":{
"1999":{
"count":4,
"freq":"14.29"
},
"2000":{
View untrusted-lvl11-solution.js
/*
* robot.js
*
* You'll need three keys in order to unlock the
* Algorithm: the red key, the green key, and the
* blue key. Unfortunately, all three of them are
* behind human-proof barriers.
*
* The plan is simple: reprogram the maintenance
* robots to grab the key and bring it through
View Throttle.swift
let subject = PassthroughSubject<Int,Never>()
let bounces:[(Int,TimeInterval)] = [
(1, 0.2),
(2, 1),
(3, 1.2),
(4, 1.5)
]
subject
@mypy-play
mypy-play / main.py
Created Oct 22, 2021
Shared via mypy Playground
View main.py
from typing import Iterator
def fib(n: int) -> Iterator[int]:
a, b = 0, 1
while a < n:
yield a
a, b = b, a + b
@KarymeTena04
KarymeTena04 / index.php
Last active Oct 22, 2021
DAWeb_Act4_While_Tena Mendoza Indra Karyme
View index.php
<?php
$contador = 1;
while( $contador <= 5 )
{
echo "<center><h1><i>Software creado por Indra Karyme Tena Mendoza</center></h1></i><br/>";
echo "<center><h2><i>Mi matricula es 0681</center></h2></i><br/>";
echo "<center><h2><i>Ahora el contador tiene un valor de [".$contador."]</center></h2></i><br/>";
$contador = $contador + 1;
}
echo "<center><h2><i><p>Terminado</p></center></h2></i>";