Skip to content

Instantly share code, notes, and snippets.

View elexfreeman's full-sized avatar

John Shepard elexfreeman

View GitHub Profile
@elexfreeman
elexfreeman / index.html
Created October 12, 2021 09:50 — forked from elijahmanor/index.html
Fill JavaScript Array #jsbench #jsperf (http://jsbench.github.io/#2bcdfb2f21a686a56efc07d17e471a85) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fill JavaScript Array #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@elexfreeman
elexfreeman / init.vim
Last active May 2, 2022 11:20
init.vim
"G Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
Plug 'christianchiarulli/nvcode-color-schemes.vim'
Plug 'pangloss/vim-javascript' " JavaScript support
Plug 'leafgarland/typescript-vim' " TypeScript syntax
/**
* для форматирования валюты
* @param n - число
* @param r - сколько знаков после запятой
*/
export const fNumToStr = (n: number, r?: number): string => {
let resp = '0';
if (r) {
#include <iostream>
#include <windows.h>
void fFeel(int aMatrix[20][20])
{
for (int x = 0; x < 20; x++)
{
for (int y = 0; y < 20; y++)
{
aMatrix[x][y] = 0;
process.env.TS_NODE_PROJECT = './tsconfig.json';
import * as moment from 'moment'
import * as mocha from 'mocha';
import { assert } from 'chai';
import axios from "axios";
<?php
class SeekableFileReader {
/* указатель на файл */
private $handle;
/* длина файла (кол-во строк)*/
private $fileLength = 0;
/* массив позиций для ф-и fseek() */
private $seekArr = [];
/* текущая позиция */
-- таблица категорий
-- индексное поле только PRIMARY KEY
CREATE TABLE IF NOT EXISTS `category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
-- таблица лайков
-- индексное поле PRIMARY KEY
<?php
/* тут подключения к базе и т.д. */
/* лучше такую обработку делать на C++ */
/* php будет трудно работать с памятью, может течь */
class EmailData {
/* список доменов */
/* $domain['gmail.com'] = 20; */
@elexfreeman
elexfreeman / Component.jsx
Created November 13, 2018 10:47 — forked from krambertech/Component.jsx
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
export interface Review {
id: number,
published: number,
date: string,
review: string,
user_img: string,
username: string
}