Skip to content

Instantly share code, notes, and snippets.

const chroma = require('chroma-js');
var Q = 255;
var color = chroma("#FF0000").rgb();
var max = Math.max.apply(null, color);
var min = Math.min.apply(null, color);
var K;
var Wo = (min/max < 0.5) ? ((min*max) / (max-min)) : (max);
if(color[0] == color[1] && color[0] == color[2] && color[0] != null) {
const {app, autoUpdater, ipcMain, ipcRenderer} = require('electron');
const ms = require('ms');
const platform = process.platform === 'darwin' ? 'osx' : process.platform;
const version = app.getVersion();
const feedUrl = `https://my-updates-here.herokuapp.com/update/${platform}`;
export default class Updater {
static remoteQuitAndInstall() {
ipcRenderer.send('quitAndInstall');
const {app, autoUpdater, dialog} = require('electron');
const ms = require('ms');
const platform = process.platform === 'darwin' ? 'osx' : process.platform;
const version = app.getVersion();
const feedUrl = `https://my-updates-here.herokuapp.com/update/${platform}`;
export default class AutoUpdater {
constructor(mainWindow) {
@weedgrease
weedgrease / hyper.js
Created March 3, 2017 20:57
Hyper Config Current
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
@weedgrease
weedgrease / cam.js
Created April 6, 2017 17:40
Cam's Project
getYourCards(numbersOnly) {
fs.createReadStream(this.imagePath).pipe(new PNG({
filterType: -1
})).on("parsed", function() {
let yourCardsSuit = [];
console.log("Array created");
console.log("Entered read stream");
// Loop through each vertical pixel of the image
for (var y = 0; y < this.height; y++) {
// Loop through each horizontal pixel of the image
@weedgrease
weedgrease / .travis.yml
Last active June 28, 2017 19:30
Ember Electron Configs
sudo: required
dist: trusty
language: node_js
osx_image: xcode8.3
group: deprecated-2017Q2
matrix:
include:
- os: linux
node_js: 6
addons:
@weedgrease
weedgrease / components.my-component.js
Created July 25, 2017 20:25 — forked from farisj/components.my-component.js
Indeterminate/Checked Inputs in Ember
import Ember from 'ember';
import _ from "lodash";
const { computed, get, set } = Ember;
export default Ember.Component.extend({
items: [],
allItems: computed.alias('items'),
selectedItems: [],
import Ember from 'ember';
import _ from "lodash";
const { computed, get, set } = Ember;
export default Ember.Component.extend({
items: [],
allItems: computed.alias('items'),
selectedItems: [],
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.