Skip to content

Instantly share code, notes, and snippets.

View akolybelnikov's full-sized avatar
:octocat:
Building the future, one line of code at a time. 🚀

reddree akolybelnikov

:octocat:
Building the future, one line of code at a time. 🚀
View GitHub Profile
@ry
ry / 20190802-oumuamua.md
Last active June 6, 2021 05:00
Example
@pjlamb12
pjlamb12 / compodoc.js
Last active September 14, 2020 12:42
Generate Compodoc Documentation for each App and Library in an Nx workspace from a script
const angularJson = require('./angular.json');
const exec = require('child_process').exec;
const fs = require('fs');
const mainProjects = Object.keys(angularJson.projects).filter(proj => !proj.includes('e2e'));
const tsConfigPaths = parseTsconfigPaths();
function parseTsconfigPaths() {
const pathsArray = [];
for (const projectName of mainProjects) {
@oseme-techguy
oseme-techguy / Correct_GnuPG_Permission.sh
Last active February 6, 2025 05:53
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
@sarahbethfederman
sarahbethfederman / RichTextRenderer.js
Last active May 12, 2021 17:56
Using contentful with gatsby and react
import React from 'react';
import { Link as GatsbyLink } from 'gatsby';
import * as deepmerge from 'deepmerge';
import { INLINES, BLOCKS, MARKS } from '@contentful/rich-text-types';
import { documentToJSX } from './../scripts/documentToJSX';
import { getEntry } from './../scripts/getContentfulEntry';
const Link = ({ children, to, activeClassName, ...other }) => {
const internal = /^\/(?!\/)/.test(to);
@JoniJnm
JoniJnm / date-fns-date-adapter.ts
Created January 4, 2019 11:44
date-fns angular material adapter
import {Injectable} from '@angular/core';
import {DateAdapter} from '@angular/material';
import {addDays, addMonths, addYears, format, getDate, getDaysInMonth, getMonth, getYear, parse, setDay, setMonth, toDate} from 'date-fns';
// CONFIG. Use environment or something for a dynamic locale and settings
import {es as locale} from 'date-fns/locale';
const WEEK_STARTS_ON = 1; // 0 sunday, 1 monday...
export const MAT_DATE_FNS_DATE_FORMATS = {
@AnthonyMikh
AnthonyMikh / main.rs
Created November 10, 2018 21:14
Решение задачи №138 от UniLecs (Максимальная последовательность по модулю)
extern crate itertools;
use itertools::{Itertools, Either::*};
// Самый первый вариант — разбиваем массив
// на вектор отрицательных чисел и вектор положительных,
// а затем возвращаем тот, для которого абсолютная сумма элементов больше.
fn max_abs_sum_subset_1(arr: &[i32]) -> Vec<i32> {
let (neg, pos): (Vec<_>, Vec<_>) = arr.iter().cloned()
.partition_map(|x| if x < 0 { Left(x) } else { Right(x) });
@aliakakis
aliakakis / match-media.js
Last active December 4, 2018 07:50
React based
/*
## Example ##
<MatchMedia mediaWidth={["(min-width: 768px)", "(min-width: 1280px)"]}>
<Checkbox
id="check_1"
label="Hello World!"
checked={isChecked}
onChange={() => this.setState({ isChecked: !isChecked })}
@joeyklee
joeyklee / mysql-setup-mac-with-sequel-pro.md
Last active November 17, 2023 05:27
Setting up mysql on mac with sequel pro and homebrew

Setup instructions

Setting up mysql on mac with sequel pro and homebrew

MacOS high sierra 10.13.6
Homebrew version 1.7.6

Assuming you've installed homebrew...

@lightdiscord
lightdiscord / netlify.sh
Last active July 5, 2021 15:20
Rust and wasm and netlify
#!/usr/bin/env bash
set -e
cweb_version=0.6.16
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz
curl -Lo cargo-web.gz $cweb
gunzip cargo-web.gz
chmod u+x cargo-web
@dabit3
dabit3 / Router.vue
Last active December 4, 2023 21:36
Using AWS Amplify Vue with routing
const router = new Router({
routes: [
{
path: '/',
name: 'Home',
component: Home,
meta: { requiresAuth: true}
},
{
path: '/notes',