Skip to content

Instantly share code, notes, and snippets.

@pheuter
pheuter / gist:3515945
Created August 29, 2012 17:33
Handlebars.js equality check in #if conditional

Handlebars.js is a template framework for Javascript environments. It allows the construction of HTML elements using HTML and expressions wrapped in {{ }}

Limitations of {{if}}

One of the conditional block helpers Handlebars offers is the {{#if}}.

For example:

<div class="entry">
import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
import { Observable } from 'rxjs';
import { tap } from 'rxjs/operators';
import { StatisticsService } from './statistics.service';
@Injectable()
export class StatisticsInterceptor implements NestInterceptor {
constructor(
private readonly statisticsService: StatisticsService,
@martani
martani / gist:944963
Created April 27, 2011 19:15
Frequency Analysis on a text (Caesar cipher + key search)
static Dictionary<char, double> AnalyseFrequency(string text)
{
if (text == null)
return null;
Dictionary<char, double> frequencies = new Dictionary<char, double>();
int textLength = text.Length;
for (int i = 0; i < textLength; i++)
{
@mreigen
mreigen / app.js
Last active April 10, 2018 17:38
Goal: 1) To remove the # hash from the url. 2) Shareable on Facebook, twitter... with dynamic meta tags
//AngularJS app
.config( function myAppConfig ($locationProvider) {
$locationProvider.html5Mode(true);
...
}