Skip to content

Instantly share code, notes, and snippets.

Eduardo Lavaque greduan

View GitHub Profile
@greduan
greduan / Makefile
Last active Apr 7, 2018
Java Makefile
View Makefile
class_d=bin
lib_d=lib
source_d=src
JAVAC=javac
JFLAGS=-g -d $(class_d) -sourcepath $(source_d) -Xlint:all
s_app=$(shell find $(source_d) -name '*.java')
c_app=$(patsubst $(source_d)/%.java, $(class_d)/%.class, $(s_app))
@greduan
greduan / handlebarsRender.js
Created Feb 3, 2018
A synchronous, minimal render()-generating function for use with Express or Koa (or whatever)
View handlebarsRender.js
const fs = require('fs')
const path = require('path')
const Handlebars = require('handlebars')
const generateHandlebarsTemplate =
templateSource => Handlebars.compile(templateSource);
module.exports = viewsPath => {
const files = fs.readdirSync(viewsPath)
@greduan
greduan / basic-server.js
Created Sep 13, 2017
Just a starter server that I've seen myself writing several times now
View basic-server.js
const path = require('path')
const express = require('express')
const morgan = require('morgan')
const app = express()
app.set('x-powered-by', false)
app.set('view engine', 'ejs')
app.set('views', path.resolve(__dirname, '..', 'views'))
@greduan
greduan / unsub-youtube.js
Created Sep 11, 2017
Mass unsub from all YT subscriptions
View unsub-youtube.js
const buttons = document.getElementsByClassName('subscribed-label')
Array.prototype.forEach.call(buttons, b => {
b.click()
const unsub = document.getElementsByClassName('overlay-confirmation-unsubscribe-button')
Array.prototype.forEach.call(unsub, u => u.click())
})
View keybase.md

Keybase proof

I hereby claim:

  • I am greduan on github.
  • I am greduan (https://keybase.io/greduan) on keybase.
  • I have a public key whose fingerprint is 2F24 E29B 1BE2 A929 5A81 9EDE 99C9 826C 54CF DECB

To claim this, I am signing this object:

View prompt-password.js
'use strict'
var Promise = require('bluebird'),
ttys = require('ttys'),
readlineSync = require('readline-sync')
module.exports = function () {
return Promise.resolve(readlineSync.question('password: ', { hideEchoBack: true }))
}
@greduan
greduan / init.js
Created Mar 9, 2016
Atom: Destroy other items in pane when we open a new item
View init.js
// We don't need empty panes
if (atom.config.get('core.destroyEmptyPanes')) {
atom.config.set('core.destroyEmptyPanes', true)
}
atom.workspace.onDidOpen(function (event) {
/**
* event = { item, pane, index }
*/
View base-model.js
var uuid = require('node-uuid')
var M = {}
M.BaseModel = Class(M, 'BaseModel').inherits(Krypton.Model)({
primaryKey: 'uuid',
prototype: {
init: function (config) {
@greduan
greduan / time-estimate
Last active Jan 5, 2016
Script to figure out how long you'll take on a ticket, worst case, expected case and best case are provided
View time-estimate
#!/usr/bin/env node
if (process.argv.length < 5) {
console.log('usage: time-estimate BEST EXPECTED WORST')
process.exit(0)
}
var best = parseFloat(process.argv[2]),
exp = parseFloat(process.argv[3]),
worst = parseFloat(process.argv[4]),
View autoexec.cfg
// Launch options:
// -novid -nod3d9ex -threads 4 -high -nojoy
// Commands (aliases)
alias "+jthrow" "+jump; -attack; -attack2"
alias "-jthrow" "-jump"
alias "+bombfind" "+use; gameinstructor_enable 1; cl_clearhinthistory"
alias "-bombfind" "-use; gameinstructor_enable 0; cl_clearhinthistory"
You can’t perform that action at this time.