Skip to content

Instantly share code, notes, and snippets.

View easingthemes's full-sized avatar
🕳️
 

Dragan Filipović easingthemes

🕳️
 
View GitHub Profile
@nyurik
nyurik / to-logical.py
Last active January 16, 2023 08:29
Script to convert SCSS files from physical to logical values for RTL and vertical languages
#
# This script converts margins, padding, and borders to logical values,
# allowing RTL and vertical languages to show correctly.
# Supports both *.css and *.scss files.
#
# Some renames are not yet implemented widely, and may require CSS plugin
# https://github.com/csstools/postcss-logical
# They have been commented out for now, but feel free to try them out.
#
# Full spec: https://drafts.csswg.org/css-logical/
@jeremyben
jeremyben / jest-coverage-badges.ts
Last active January 26, 2022 05:38
Get shields.io badges for jest coverage.
// Make sure you have json-summary as a coverage reporter in your jest config.
// coverageReporters: ['json-summary', 'text', 'lcov']
import { readFileSync, mkdirSync, writeFileSync } from 'fs'
import { join } from 'path'
import { get } from 'https'
import { ok } from 'assert'
Promise.resolve().then(async () => {
const outputDir = join(process.cwd(), 'badges')
@matthewsuan
matthewsuan / axios.js
Last active March 28, 2024 12:36
Axios request queue-like that limits number of requests at any given time
import axios from 'axios'
const MAX_REQUESTS_COUNT = 5
const INTERVAL_MS = 10
let PENDING_REQUESTS = 0
// create new axios instance
const api = axios.create({})
/**
@Prasad9
Prasad9 / annotation.xml
Created November 6, 2017 13:54
A sample XML annotation file based on Pascal VOC format.
<annotation>
<folder>GeneratedData_Train</folder>
<filename>000001.png</filename>
<path>/my/path/GeneratedData_Train/000001.png</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>224</width>
<height>224</height>
defaults: &defaults
working_directory: /home/circleci/kotlin-spring-boot-reactjs-poc
docker:
- image: circleci/openjdk:8-jdk-browsers
version: 2
jobs:
build:
<<: *defaults
steps:
<alignment jcr:primaryType="nt:unstructured"
name="./alignChildren"
fieldLabel="Alignment of components"
required="{Boolean}true"
selectionMode="single"
sling:resourceType="granite/ui/components/coral/foundation/form/buttongroup">
<items jcr:primaryType="nt:unstructured">
<default jcr:primaryType="nt:unstructured"
name="./default"
@heyimalex
heyimalex / example.js
Created September 21, 2016 16:15
Using mock-fs with jest
// __tests__/example.js
jest.mock('fs');
it('should serve as a nice example', () => {
const fs = require('fs')
// fs can be set up at any point by calling __configureFs.
fs.__configureFs({
'/test': {
@dazld
dazld / component.txt
Last active June 20, 2021 16:37
AEM Sightly JS globals, currentPage investigations
accessible
adaptTo
analyzable
cellName
childEditConfig
class
componentGroup
container
declaredChildEditConfig
declaredEditConfig
@JRGould
JRGould / deep-thoughts-plugin.php
Created August 27, 2015 05:43
Deep Thoughts WordPress Functionality Plugin
<?php
/*
Plugin Name: Deep Thoughts Functionality
Description: API Modifications for my Deep Thoughts React Native app.
Author: Jeffrey Gould
Version: 0.1
Author URI: http://jrgould.com
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@yesvods
yesvods / gist:51af798dd1e7058625f4
Created August 15, 2015 11:13
Merge Arrays in one with ES6 Array spread
const arr1 = [1,2,3]
const arr2 = [4,5,6]
const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6]