Skip to content

Instantly share code, notes, and snippets.

@m-hatch
m-hatch / font-awesome.js
Created July 11, 2018 03:14 — forked from gbertb/font-awesome.js
How to load Font Awesome asynchronously
<!--
How to load Font Awesome asynchronously
Use: Just put this script on the bottom/footer of your web
-->
<script type="text/javascript">
(function() {
var css = document.createElement('link');
css.href = '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css';
@m-hatch
m-hatch / request.js
Created May 24, 2018 14:42
Example of requests from server or browser: callback, promise, generator, async/await
// callback request
const request = require('request')
request('http://localhost:3000/', (err, res, body) => {
console.log('callback: ', body)
})
// promise request
const requestpromise = require('request-promise')
requestpromise('http://localhost:3000/')
.then(res => {
@m-hatch
m-hatch / index.html
Created May 17, 2018 14:29
React Playground
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>React Playground</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
</head>
@m-hatch
m-hatch / gist:538fc29d663f5c9e2f84fd954f226383
Created February 21, 2018 15:36 — forked from beshur/gist:4124512
Sublime Text 2 - Useful Shortcuts Windows

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@m-hatch
m-hatch / gist:395c68b40eefaeee9b45ac5f03ed6d48
Created February 21, 2018 15:35 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
<%@ include file="/WEB-INF/jsp/include/imports.jsp" %>
<jsp:useBean id="random" class="java.util.Random" scope="application"/>
<hst:link var="themesLink" siteMapItemRefId="themesId"/>
<hst:link var="artistsLink" siteMapItemRefId="artistsId"/>
<hst:link var="countriesLink" siteMapItemRefId="countriesId"/>
<div class="panel">
<c:if test="${ not empty info.heading }">
package org.acm.artists.componentinfo;
import org.hippoecm.hst.core.parameters.DropDownList;
import org.hippoecm.hst.core.parameters.FieldGroup;
import org.hippoecm.hst.core.parameters.FieldGroupList;
import org.hippoecm.hst.core.parameters.Parameter;
@FieldGroupList({
@FieldGroup(titleKey = "group.heading", value = {"heading", "heading.level"}),
@FieldGroup(titleKey = "group.themes", value = {"showthemes", "isopenthemes"}),
package org.acm.artists.components;
import java.util.List;
import org.acm.components.BaseComponent;
import org.acm.artists.common.dao.ArtistsDao;
import org.acm.artists.common.domain.Artist;
import org.acm.artists.common.domain.ArtistCountry;
import org.acm.artists.common.domain.ArtistTheme;
import org.acm.artists.componentinfo.ArtistsListComponentInfo;
import org.hippoecm.hst.core.component.HstComponentException;
package org.acm.artists.common.dao;
import java.io.IOException;
import org.acm.common.Constants;
import org.acm.common.dao.BaseRestClientDao;
import org.acm.common.dao.DaoException;
import org.acm.common.utils.Labels;
import org.acm.artists.common.domain.FilmObj;
import org.acm.artists.common.domain.ArtistCountryList;
import org.acm.artists.common.domain.ArtistList;
/*
* Base template for Gulp builds
* Assumes the following structure:
.
├── app
│ ├── css
│ ├── fonts
│ ├── img
│ ├── js
│ └── src