Skip to content

Instantly share code, notes, and snippets.

const downloadFile = async () => {
setDownLoading(true);
setProgress(0);
let content;
if (files && files.length > 0) {
content = JSON.stringify({
"package-name": props.filename ?? "download-bundle.zip",
"error-log-name": "errors.txt",
groups: [
@cullophid
cullophid / featureTypeResolution.js
Last active September 16, 2019 20:16
Feature Type resolution
const resolveFeatureTypes = (userSelection, data) => {
const resolved = {}
const visited = {}
const resolveFeatureType = (id) => {
// If we have already resolved this feature type we return the result
if (resolved[id]) {
return resolved[id]
}
// If we have visited the feature types, but not resolved it we have ciscular dependencies
@cullophid
cullophid / index.js
Created October 22, 2015 20:21
MessageModule
import message from './message'
console.log(message);
import React from 'react';
import styles from './Cover.css';
import withStyles from '../../decorators/withStyles';
import Link from '../../utils/Link';
import Avatar from './Avatar';
import { Button } from 'react-bootstrap';
@withStyles(styles)
class Cover extends React.Component {
@cullophid
cullophid / gist:411e3dfb9e5fb44ee202
Last active August 29, 2015 14:16
Atom snippets
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@cullophid
cullophid / js.lint.browser.sublime-snippet
Created March 14, 2014 11:48
sublime snippet for jslint browser headers. trigger:jslint
<snippet>
<content><![CDATA[
/*jslint browser:true, nomen:true*/
/*global app:true, \$:true, console: false*/
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>jslint</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
@cullophid
cullophid / js.jslint.node.sublime-snippet
Created March 14, 2014 11:48
sublime-snippet for node jslint header. trigger:jslint
<snippet>
<content><![CDATA[
/*jslint node:true, nomen:true*/
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>jslint</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
@cullophid
cullophid / js.jquery.plugin.sublime-snippet
Created March 14, 2014 11:47
jquery plugin snippet. trigger:jquery
<snippet>
<content><![CDATA[
/**
* ${1:name}
*/
/*jslint browser: true, nomen:true*/
/*global \$:true, console:false*/
(function () {
"use strict";
\$.fn.${2:func} = function (${3:params}) {
@cullophid
cullophid / js.inxite.model.sublime-snippet
Created March 14, 2014 11:45
sublime snippet for frontend model classes. Tab-trigger : inxite
<snippet>
<content><![CDATA[
/**
* ${1:filename}.js
* Model class for ${1}
* @author ${3:author}
* @date ${4:dd}/${5:mm}/${6:yyyy}
*/
/*jslint browser:true, nomen:true*/
@cullophid
cullophid / .jshintrc
Created March 14, 2014 10:34
inxite - .jshintrc
{
"bitwise" : true,
"camelCase" : true,
"curly" : true,
"eqeqeq":true,
"forin":true,
"freeze":true,
"indent" :4,
"latedef":true,
"newcap":true,