Skip to content

Instantly share code, notes, and snippets.

Avatar
🕳️
 

Dragan Filipović easingthemes

🕳️
 
View GitHub Profile
@matthewsuan
matthewsuan / axios.js
Last active Mar 1, 2021
Axios request queue-like that limits number of requests at any given time
View axios.js
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 Nov 6, 2017
A sample XML annotation file based on Pascal VOC format.
View annotation.xml
<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>
View config.yml
defaults: &defaults
working_directory: /home/circleci/kotlin-spring-boot-reactjs-poc
docker:
- image: circleci/openjdk:8-jdk-browsers
version: 2
jobs:
build:
<<: *defaults
steps:
View buttongroup.xml
<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 Sep 21, 2016
Using mock-fs with jest
View example.js
// __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 Jun 8, 2018
AEM Sightly JS globals, currentPage investigations
View component.txt
accessible
adaptTo
analyzable
cellName
childEditConfig
class
componentGroup
container
declaredChildEditConfig
declaredEditConfig
@JRGould
JRGould / deep-thoughts-plugin.php
Created Aug 27, 2015
Deep Thoughts WordPress Functionality Plugin
View deep-thoughts-plugin.php
<?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 Aug 15, 2015
Merge Arrays in one with ES6 Array spread
View gist:51af798dd1e7058625f4
const arr1 = [1,2,3]
const arr2 = [4,5,6]
const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6]
@nateyolles
nateyolles / curlPackageFilterRules.sh
Last active Sep 28, 2020
AEM/CQ cURL: Adding include/exclude rules to package filters
View curlPackageFilterRules.sh
# Adding include/exclude rules to CQ/AEM package filters through cURL.
# Through a simple search, you will find numerous lists of CQ/AEM cURL commands.
# However, I haven't seen an example of adding rules to package filters. The
# JSON "rules" key takes an array value. You can leave the array empty if you
# don't need to include any rules. The array is of JSON objects with a
# "modifier" key and value of "include" or "exclude", and a "pattern" key with
# your path or regular expression as the value.
# create package
@ghinda
ghinda / object-to-form-data.js
Last active Mar 7, 2021
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
View object-to-form-data.js
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {