This file contains hidden or 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
Show hidden characters
{ | |
"jsRules": { | |
"align": false, | |
"arrow-parens": false, | |
"arrow-return-shorthand": false, | |
"ban": false, | |
"ban-comma-operator": false, | |
"binary-expression-operand-order": false, | |
"class-name": false, | |
"comment-format": false, |
This file contains hidden or 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 getLocalIP() | |
{ | |
var ip = []; | |
window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection || false; | |
if (window.RTCPeerConnection) | |
{ | |
var pc = new RTCPeerConnection({iceServers:[]}), noop = function(){}; | |
pc.createDataChannel(''); | |
pc.createOffer(pc.setLocalDescription.bind(pc), noop); |
This file contains hidden or 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
export interface Func<a, b> { | |
f: (_: a) => b | |
then: <c>(this: Func<a, b>, g: Func<b, c>) => Func<a, c> | |
repeat: (this: Func<a, a>) => Func<number, Func<a, a>> | |
repeatUntil: (this: Func<a, a>) => Func<Func<a, boolean>, Func<a, a>> | |
} | |
export let Func = <a, b>(f: (_: a) => b): Func<a, b> => { | |
return { | |
f: f, |
This file contains hidden or 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
<?php | |
function toString($value) { | |
if ($value === TRUE) return 'TRUE'; | |
if ($value === FALSE) return 'FALSE'; | |
if ($value === null) return 'null'; | |
if (is_string($value)) return '"' . $value . '"'; | |
return $value; | |
} |
This file contains hidden or 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
/** | |
* Force directed graph layout algorithm according to Fruchterman and Reingold's principle. | |
* The algorithm can be summarized as follows: | |
* algorithm SPRING(G:graph); | |
* place vertices of G in random locations; | |
* repeat N times | |
* calculate the force on each vertex; | |
* move the vertex c4 | |
* draw graph on canvas, plotter or any drawing tool. | |
* |
This file contains hidden or 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
{ | |
"description": "The array of models of the application.", | |
"type": "array", | |
"uniqueItems": true, | |
"items": { | |
"type": "object", | |
"required": [ | |
"name", | |
"attributes", | |
"permissions" |
This file contains hidden or 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
.col-1 {width: 8.33%;} | |
.col-2 {width: 16.66%;} | |
.col-3 {width: 25%;} | |
.col-4 {width: 33.33%;} | |
.col-5 {width: 41.66%;} | |
.col-6 {width: 50%;} | |
.col-7 {width: 58.33%;} | |
.col-8 {width: 66.66%;} | |
.col-9 {width: 75%;} | |
.col-10 {width: 83.33%;} |
This file contains hidden or 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
import csv | |
import os | |
from os import listdir | |
from os.path import isfile, join | |
from glob import glob | |
from pathlib import Path | |
import shutil | |
import datetime | |
import functools |
This file contains hidden or 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
public interface IList<T> | |
{ | |
public bool isEmpty { get; set; } | |
public IList<T> Add(T v); | |
public U Reduce<U>(Func<T, U, U> f, U init); | |
public IList<U> Map<U>(Func<T, U> f); | |
} | |
public class Node<T> : IList<T> | |
{ |
This file contains hidden or 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
export interface Page<T> { | |
items: T[] | |
index: number | |
total_pages: number | |
page_size: number | |
current_page: number | |
} | |
export const getPage = <T>(list: T[], page_index: number, page_size: number): Page<T> => { |
OlderNewer