Skip to content

Instantly share code, notes, and snippets.

@dunstontc
dunstontc / indentions.html
Created April 28, 2017 02:52
4-space nbsp tabs
"Indent1": {
"prefix": "ind1",
"body": "<!--1 Indent-->&nbsp;&nbsp;&nbsp;&nbsp;",
"description": "4 &nbsp;'s"
},
"Indent2": {
"prefix": "ind2",
"body": "<!--2 Indent-->&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
"description": "8 &nbsp;'s"
},
@dunstontc
dunstontc / ul.html
Created April 28, 2017 02:54
well they're never empty...
"Unordered List (x1)": {
"prefix": "ul",
"body": [
"<ul>",
" <li>$0</li>",
"</ul>"
],
"description": "ul > li "
}
@dunstontc
dunstontc / styles.less
Created April 28, 2017 07:09 — forked from peterpme/styles.less
Operator Mono and Fira Code working together in Atom
// ...
atom-workspace,
atom-text-editor {
font-family: "Fira Code";
text-rendering: optimizeLegibility;
font-size: 17px;
font-weight: 400;
line-height: 1.8;
}
@dunstontc
dunstontc / (seeds).js
Last active June 4, 2017 19:28
SQLite w/ Knex
exports.seed = function(knex, Promise)
{
var tableName = 'Notes';
var rows =
[
{category_id: 1, subject_id: 1, title: 'Numero Uno', note: "Test #1"}, // 1
{category_id: 2, subject_id: 1, title: 'Numero Dos', note: "Finish this list"}, // 2
{category_id: 3, subject_id: 1, title: 'Numero Tres', note: "www.google.com"}, // 3
/* ID Generator:
*
* You can use an infinite while in a generator function to create
* a function that will generate a new ID every time next() is called on it.
* In this case the infinite loop is not dangerous
* because it will only execute once with calls to next().
*
*/
function* idGen(){
@dunstontc
dunstontc / atom-path.js
Last active June 8, 2017 00:06
atom & the fs
/** @babel */
const fs = require('fs-plus')
const path = require('path')
const hasWriteAccess = (dir) => {
const testFilePath = path.join(dir, 'write.test')
try {
fs.writeFileSync(testFilePath, new Date().toISOString(), { flag: 'w+' })
fs.unlinkSync(testFilePath)
'use strict';
module.exports = (fn) => {
return function () {
const length = arguments.length;
const args = new Array(length);
for (let i = 0; i < length; i += 1) {
args[i] = arguments[i];
@dunstontc
dunstontc / wrap-text.js
Created June 25, 2017 23:28
wrap some text
function wrapText (text, token) {
const length = token.length
if ((text.substr(0, length) === token) && (text.substr(-length) === token)) {
return text.substr(length, text.length - length * 2)
} else {
return token + text + token
}
}
@dunstontc
dunstontc / 0_reuse_code.js
Created July 29, 2017 17:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dunstontc
dunstontc / webpack.readme.md
Created September 4, 2017 17:31
Webpack's stylish readme file


[![npm][npm]][npm-url]

[![node][node]][node-url]