Skip to content

Instantly share code, notes, and snippets.

View willyelm's full-sized avatar

Will Medina willyelm

View GitHub Profile
@willyelm
willyelm / ghostty-config
Last active March 24, 2026 03:32
My personal ghostty config
# Theme
background = #151515
foreground = #BCBCBC
cursor-color = #BCBCBC
cursor-style = block
cursor-style-blink = false
selection-background = #A6A6A6
selection-foreground = #202020
@willyelm
willyelm / index.html
Created August 17, 2017 01:16 — forked from nolanlawson/index.html
IndexedDB with Web Workers
<html>
<body>
<span id="output"></span>
</body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="main.js"></script>
</html>
(function () {
// IndexedDB
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB,
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction,
dbVersion = 1.0;
// Create/open database
var request = indexedDB.open("elephantFiles", dbVersion),
db,
createObjectStore = function (dataBase) {
@willyelm
willyelm / webpack-angular-uglify.ts
Created April 25, 2017 15:56
Uglify angular bundle.
const { optimize } = require('webpack')
module.exports = {
// webpack config...
plugins: [
new optimize.UglifyJsPlugin({
beautify: false,
output: {
comments: false
},
@willyelm
willyelm / webpack-angular-pug-template.ts
Created April 24, 2017 21:13
Adding Pug for angular compilation
module.exports = {
// webpack config...
module: {
loaders: [
// other loaders...
{
test: /\.pug$/,
loaders: [
'html-loader', {
loader: 'pug-html-loader',
@willyelm
willyelm / webpack-ngtools-plugin.ts
Last active April 24, 2017 21:31
Webpack NgTools Usage
const { AotPlugin } = require('@ngtools/webpack')
module.exports = {
// webpack config...
plugins: [
new AotPlugin({
tsConfigPath: './src/tsconfig.app.json',
mainPath: path.resolve(__dirname, 'src', 'main.ts'),
skipCodeGeneration: true // Toggle for AOT compilation
})
@willyelm
willyelm / pre-commit
Last active May 25, 2016 16:19
Git Hook: pre-commit
#!/usr/bin/env node
'use strict'
const exec = require('child_process').exec
const fs = require('fs')
const eslint = require('../node_modules/eslint/lib/cli')
let files
let child = exec("git diff-index --cached --name-only HEAD", (error, stdout, stderr) => {
files = stdout.split('\n').filter((i) => {
function coroutine () {
return new Promise((resolve, reject) => {
var args = Array.prototype.slice.call(arguments)
var fn = args.shift()
var gen = fn.apply(this, args)
function next (er, res) {
var c = gen.next(res)
if (c.done) {
resolve(c.value)
'use strict';
const Promise = require('bluebird');
function someAsyncTask() {
return new Promise(function(resolve) {
let delay = Math.floor(Math.random() * 10000);
setTimeout(function () {
resolve(delay);