Skip to content

Instantly share code, notes, and snippets.

View gregcowley's full-sized avatar

Gregory Cowley gregcowley

  • San Francisco
View GitHub Profile
@maggiesavovska
maggiesavovska / recursivefs.js
Last active January 14, 2017 16:25
node.js recursive function to read all files in directory (searches through all directories to find files)
//******************************************************/
//Include all files going one directory deep
//* @param {String} d - directory name of directory where search is occurring
//* @param {Array || String} exclude - array of file names {STRING} to skip
//******************************************************/
function fileSearch(d, exclude){
var exclude = exclude || [];
@staskochkin
staskochkin / bind.js
Created October 1, 2016 13:05
Recursively search binaries files in specified directory, lip them via libtool utility to fat binary file
var fs = require("fs");
var path = require("path");
var exec = require('child_process').execSync;
var dirPath = process.argv[2];
var output = process.argv[3];
Array.prototype.flatMap = function(lambda) {
return Array.prototype.concat.apply([], this.map(lambda));
};
@sparkalow
sparkalow / list-files-in-folders.gs
Created September 21, 2016 17:42
Google Apps Script to recursively list files in a folder
/*
Recusrsively add a list of files from a named foler to a sheet
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var searchMenuEntries = [{
name: "Create List from Folder",
functionName: "start"
}];
@alana314
alana314 / findexternallinks.js
Created September 16, 2016 22:56
Use node.js and jquery (cheerio) to recursively search files for external links
@fernviridian
fernviridian / find.sh
Last active January 14, 2017 17:59
find string in files from current directory without git grep
# simple script to find content of files based on extensions
# and a given string
# usage ./find.sh "some string to find in files" .py
# will find all instances where that string was in a file.py
phrase=$1
fileextension=$2
for file in `find $(pwd) -name \*$fileextension -print`; do
if [ -e $file ]; then
cat $file | grep -i "$phrase";
if [ $? -eq 0 ]; then
@maruf89
maruf89 / coffee2js_beautify.js
Last active January 17, 2017 15:48
Compiles all coffeescript files into JS while preserving single line comments then it beautifies the compiled javascript before saving it alongside the coffeescript files.
"use strict";
var fs = require('fs'),
cs = require('coffee-script'),
os = require('os'),
glob = require('glob'),
beautify = require('js-beautify').js_beautify,
mkdirp = require('node-mkdirp');
var path = require('path');
@tmandry
tmandry / windowtracker.lua
Created May 27, 2015 17:07
windowtracker
--- === windowtracker ===
--- Track all windows on the screen.
---
--- You can watch for the following events:
--- * windowtracker.windowCreated: A window was created.
--- * windowtracker.windowDestroyed: A window was destroyed.
--- * windowtracker.mainWindowChanged: The main window was changed. This is usually the same as the
--- focused window, except for helper dialog boxes like file open windows and the like, which are
--- not reported by this event.
--- * windowtracker.windowMoved: A window was moved.
@gregsh
gregsh / - IDE Scripting.md
Last active March 12, 2026 04:26
IDE Scripting

Here are my attempts to script an IntelliJ-based IDE using javax.script.* API (ex-JSR-223).

The list of available scripting languages and engines:

  1. Groovy - built-in, via Groovy jars and <app>/lib/groovy-jsr223-xxx.jar
  2. JavaScript (Nashorn) - built-in, via Java Runtime <app>/jbr/... (deprecated and will be removed soon)
  3. JavaScript (GraalJS) - https://plugins.jetbrains.com/plugin/12548-intellij-scripting-javascript
  4. JPython - https://plugins.jetbrains.com/plugin/12471-intellij-scripting-python
  5. JRuby - https://plugins.jetbrains.com/plugin/12549-intellij-scripting-ruby
  6. Clojure - https://plugins.jetbrains.com/plugin/12469-intellij-scripting-clojure
@mkuron
mkuron / Makefile
Last active March 21, 2021 21:39
Flash Player Update Script for Mac OS X
install:
cp de.kuron-germany.flash-update.plist /Library/LaunchDaemons/
mkdir -p /usr/local/bin
cp flash_check.sh /usr/local/bin/
launchctl load /Library/LaunchDaemons/de.kuron-germany.flash-update.plist
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active March 4, 2026 20:59
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html