Skip to content

Instantly share code, notes, and snippets.

View nikoloza's full-sized avatar
🌀
symbo.ls

Nika nikoloza

🌀
symbo.ls
View GitHub Profile
{
"main": {
"title": "ინოვაციური განათლების ლაბორატორია",
"paragraph": "კოლაბის გუნდი იზრნუბეს რომ კურსის თითეულმა წევრი აქტიურად შეუდგეს კარიერულ განვითარებას და შეძლოს ინდუსტრიაში საინტერესო მოღვაწეობა.",
"general_courses": {
"title": "ძირითადი კურსები",
"paragraph": "საავტორო კურსები რომლის განმავლობაში მაქსიმალურად ვეცდებით ვფოკუსირდეთ პრაქტიკული გამოცდილების დაგროვებაზე. მთლიანი პროცესი გვუსრს წარიმართოს მრგვალი მაგიდის პრინციპით, რაც მოგვცეს იმის საშუალებას რომ კურსი არ იყოს მოსაწყენი და მონოტორული."
}
},
@nikoloza
nikoloza / getJSONFromFigmaFile.js
Created March 1, 2021 11:32 — forked from souporserious/getJSONFromFigmaFile.js
Generates JSON from Figma file
import request from 'request'
const api_endpoint = 'https://api.figma.com/v1'
const personal_access_token = 'FIGMA_ACCESS_TOKEN_HERE' // https://www.figma.com/developers/docs#auth-dev-token
function downloadSvgFromAWS(url) {
return new Promise((resolve, reject) => {
request.get(
url,
{
:root {
--tooltip-color: snow;
--tooltip-background: #333;
--tooltip-border-radius: 3px;
--tooltip-font-size: 14px;
--tooltip-padding: 6px 8px;
}
[data-tooltip] {
position: relative;
@nikoloza
nikoloza / mixTwoRgb.js
Last active February 14, 2017 11:09
Combine RGB(A) colors with specific range
function mixTwoRgb (colors, range = 50) {
let arr = [], i = 0
for (let i = 0; i < 3; i++) {
arr[i] = Math.round(
colors[0][i] + (
(colors[1][i] - colors[0][i]) * range / 100
)
)
}
return `rgb(${arr})`
@nikoloza
nikoloza / ParenthesesVerify.md
Created October 11, 2016 08:10
Verify parentheses

Parentheses verify function

Function verifies whether string has wrong order of parentheses or not. I made two ways of solving this, normal using for loop, and functional using filter and reduce.

It also includes unit tests for both functions and you can see it online here: for-loop and functional. Here are performance tests comparing their speed.

The code syntax is based on ES6 and Standard.

@nikoloza
nikoloza / Flatten.md
Last active October 11, 2016 08:13
Array Deep Flatten function

Array Deep Flatten function

Array flatten functionality in JavaScript. Used functional way of solving this task and it gives really cool performance (more than 2 times faster than setting as an Array method).

Here are unit and performance tests which are given in this gist also. For online view, see unit and performance tests on RequireBin (please check console for results). They are compared against lodash.flattendeep solution.

The code syntax is based on ES6 and Standard.

@nikoloza
nikoloza / hackRandom.js
Last active October 10, 2016 20:20
I've heard Math.random() is based on timestamp. I wanted to check how we can predict it with maximum accuracy. So if that two numbers are close together (can be the same in multithreads maybe), we can definitely check and hack any system based on Math.random().
(function(interval){
const start = Date.now()
const end = start + 1000
let i = 0
function hackRandom () {
let now = Date.now()
if (now > end) {
console.log(`timestamp: ${now}`, `random: ${Math.random()}`)
i++
}
@nikoloza
nikoloza / parser.js
Last active September 12, 2016 09:59
Clean Vigour CSS from unwanted properties
var fs = require('fs')
var LineByLine = require('line-by-line')
var bundle = 'bundle.css'
var _bundle = '_bundle.css'
var file = 'new.less'
var _file = '_new.less'
var cleanRegEx = /^((\s+)?((\.|\@|\d).+|color|background|border|a|html|body|div|section|div|body|section|img|thumb|\:\:).+|((\s+)?\}))/m
var emptyRegEx = /^((.+\,\n)+)?(.+\{)(\n+|\s+)\}\n?/gm
@nikoloza
nikoloza / install.js
Last active September 12, 2016 09:59
installing Vigour repos and link them
'use strict'
var cp = require('child_process')
var fs = require('fs')
var installOthersSetting = true
var pull = true
const GLOBAL_MODULES = __dirname + '/hacked_node_modules'
// prop clean up nodemodules linkers -- else npm is become a problem
var mySetup = {
@nikoloza
nikoloza / md-server.js
Last active June 4, 2016 23:49
Use README.md file as a homepage for Express based services
var express = require('express')
var marked = require('marked')
var app = express();
// use README.md file as a homepage
app.get('/', function(req, res) {
res.set('content-type','text/html');
res.send(
'<style>' +
fs.readFileSync('./node_modules/github-markdown-css/github-markdown.css') +