Skip to content

Instantly share code, notes, and snippets.

@crissdev
crissdev / Base32.cs
Created April 12, 2024 10:11 — forked from erdomke/Base32.cs
Base32 Encoding and Decoding in C#
/*
* Derived from https://github.com/google/google-authenticator-android/blob/master/AuthenticatorApp/src/main/java/com/google/android/apps/authenticator/Base32String.java
*
* Copyright (C) 2016 BravoTango86
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0

Install ffmpeg

brew install ffmpeg

Download file through url, like this:

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
@crissdev
crissdev / byte.js
Created May 17, 2021 17:49
Using Symbol.toPrimitive and toJSON method for better code
class Byte {
#value
constructor(value = 0) {
this.#value = value
}
toJSON() {
return this.#value
}
@crissdev
crissdev / print_filter.js
Created April 25, 2020 16:57 — forked from xhinking/print_filter.js
Crossfilter & dc filter printer source: codeproject
function print_filter(filter) {
var f=eval(filter);
if (typeof(f.length) != "undefined") {}else{}
if (typeof(f.top) != "undefined") {f=f.top(Infinity);}else{}
if (typeof(f.dimension) != "undefined") {f=f.dimension(function(d) { return "";}).top(Infinity);}else{}
console.log(filter+"("+f.length+") = "+JSON.stringify(f).replace("[","[\n\t").replace(/}\,/g,"},\n\t").replace("]","\n]"));
}
@crissdev
crissdev / proiect-uia.trig
Created May 22, 2018 13:50
Proiect Web Semantic (former UIA)
@prefix : <http://crissdev.com#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
:Ontology {
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@crissdev
crissdev / introrx.md
Last active September 9, 2015 09:25 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@crissdev
crissdev / meta-tags.md
Last active September 4, 2015 12:08 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
<!DOCTYPE html>
<html>
<head>
<title>Test page</title>
<meta http-equiv="X-UA-Compatible" content="IE=8"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.11/es5-shim.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json2/20150503/json2.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.3.0/knockout-debug.js" type="text/javascript"></script>
<script src="https://cdn.rawgit.com/crissdev/knockout.mapping/master/dist/knockout.mapping.js" type="text/javascript"></script>
@crissdev
crissdev / rx-dom.d.ts
Last active September 20, 2017 10:34
Typescript definition file for RxJS-DOM
///<reference path="../rx/rx.d.ts"/>
declare module Rx {
declare module DOM {
export interface AjaxSettings {
async?: boolean;
body?: string;
// This options does not seem to be used in the code yet
// contentType?: string;
crossDomain?: boolean;