Skip to content

Instantly share code, notes, and snippets.

View elis's full-sized avatar
Doing Open-source

Eli Sklar elis

Doing Open-source
View GitHub Profile
elis / nodejs.signfile.js
Created March 23, 2021 21:16 — forked from zfael/nodejs.signfile.js
Node.JS - CRYPTO How to sign a file
View nodejs.signfile.js
//how to execute: node sign.js <path file> <path private key>
//output: signature of file
var crypto = require('crypto');
var fs = require('fs');
var args = process.argv.slice(2);
var fileName = args[0];
var keyPath = args[1];
//openssl genrsa -out key.pem 1024
elis / nodejs.verifysignedfile.js
Created March 23, 2021 21:16 — forked from zfael/nodejs.verifysignedfile.js
Node.Js - CRYPTO How to verify a signed file
View nodejs.verifysignedfile.js
//how to execute: node verify.js <path file that you want to verify> <certificate path> <hash generate by sign.js>
//output: true if files are equal, false otherwise.
var crypto = require('crypto');
var fs = require('fs');
var args = process.argv.slice(2);
var fileName = args[0];
var certPath = args[1];
var sig = args[2];
elis /
Last active July 4, 2023 13:19 — forked from jamesmacfie/
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose

Save and open the script in your editor of choice.

View context.js
import React from 'react'
import { withMultiContext } from 'with-context'
const contexts = (ctx => {
const results = []
let keys = ctx.keys()
let values =
for (const [index, dir] of Object.entries(keys)) {
const match = dir.match(/^\.\/([^/]+)$/)
if (!match) continue
View block_ 511556.json
{ "blocks" : [
View timeleftprinter.js
// ==UserScript==
// @name Robin Time Left Printer
// @description Violently Butchered Robin Assistant
// @namespace com.github.cptasgard
// @include
// @include
// @version 1.9
// @author LeoVerto, Wiiplay123, Getnamo, CptAsgard
// @grant none
// ==/UserScript==
View docular example
docular: {
useHtml5Mode: true, //Use angular's html5 mode? true/false.
docular_webapp_target: 'docs', //The place where the docs will be generated
showAngularDocs: true,
showDocularDocs: false,
examples: {}, //instructions for how to run the sandboxed examples
groups: [
groupTitle: 'App Stuff',
groupId: 'app',
View gist:0b17702c4c38056aa9f4
let dat = (y,x) => (console.log('x', x, 'y', y) && false) || (x+y);
// let outer = (word) => ((logger = (letter) => for (i=0; i<letter.length; ++i) console.log(letter.charCodeAt(i))) && false) || (logger(word));
// outer('It\'s a test'); // Fails
let arrays = (word) =>, (letter, pos) => console.log(letter, word.charCodeAt(pos)))
// arrays('this is testing'); // Works
let each = (ar, fn) =>, fn);
View popup handling
actions: {
deleteDataset: function (dataset) {
var self = this;
var cds = self.controllerFor('bigquery/modals/deleteDataset'), // controller for popup
bigquery = self.controllerFor('bigquery');
cds.set('dataset', dataset);
cds.set('closeCallback', function (confirmed) {
if (confirmed) {
View my queries route
export default Ember.Route.extend({
needs: ['bigquery', 'currentUser'],
model: function (params, transition) {
console.log('ttk model for queries?', params, transition.targetName);
var store = this.get('store'),
projectId = this.get('controllers.bigquery.activeProjectId');
var queries = store.find('query', {
projectId: params.project_id,