Skip to content

Instantly share code, notes, and snippets.

Avatar

Aparajita Fishman aparajita

View GitHub Profile
@aparajita
aparajita / A4D_Init.txt
Last active Aug 29, 2015
A4D_Init method
View A4D_Init.txt
`METHOD: A4D_Init{(inStartWebServer)}
`
`Part of Active4D, the ultimate 4D web environment
`Copyright © Aparajita Fishman, All Rights Reserved
C_BOOLEAN($1;$inStartWebServer)
If (Count parameters=0)
$inStartWebServer:=True
Else
View convert_to_utf8.py
#!/usr/bin/env python
import codecs
import os
from os.path import join
import re
import sys
if len(sys.argv) < 3:
@aparajita
aparajita / yarnls.js
Last active Mar 2, 2018
yarnls.js: The missing yarn command. Lists only the top level packages in the current directory.
View yarnls.js
#!/usr/bin/env node
'use strict';
const child_process = require('child_process');
const format = require('util').format;
const fs = require('fs');
const path = require('path');
function parseOptions() {
View AppDelegate.js
export default class AppDelegate extends UIResponder { // eslint-disable-line
applicationPerformFetchWithCompletionHandler(application, completionHandler) {
console.log('App is running in background')
// Check for new data
const newData = true
// If new data exists, initiate a local notification
if (newData) {
// Let the OS know that there were new data and complete the task
@aparajita
aparajita / npmls.js
Last active Jan 4, 2020
npmls: A (much) better npm listing tool
View npmls.js
#!/usr/bin/env node
"use strict";
const child_process = require("child_process");
const fs = require("fs");
const help = `Usage: npmls.js [-gh|--help] [filter...]
** Requires Node >= 4 **
View npm-debug.log
0 verbose cli [
0 verbose cli '/Users/aparajita/.fnm/node-versions/v15.0.1/installation/bin/node',
0 verbose cli '/Users/aparajita/.fnm/node-versions/v15.0.1/installation/bin/npm',
0 verbose cli 'publish',
0 verbose cli '--ignore-scripts',
0 verbose cli '--publish-branch',
0 verbose cli 'main',
0 verbose cli '--dry-run'
0 verbose cli ]
1 info using npm@7.0.3
@aparajita
aparajita / hosts
Created Feb 23, 2019
hosts file entries to block Facebook
View hosts
# Block facebook!
0.0.0.0 static.ak.fbcdn.net
0.0.0.0 www.connect.facebook.net
0.0.0.0 www.facebook.com
0.0.0.0 www.fbcdn.com
0.0.0.0 www.fbcdn.net
0.0.0.0 www.graph.facebook.com
0.0.0.0 www.login.facebook.com
0.0.0.0 www.s-static.ak.facebook.com
0.0.0.0 www.static.ak.connect.facebook.com
@aparajita
aparajita / upgrade-node.sh
Last active Apr 17, 2021
Shell script to install the latest Node version using fnm, pnpm and jq
View upgrade-node.sh
#!/bin/bash
localVersion=$(fnm ls | tail -n 1 | perl -n -e '/^.*(v\d+\.\d+\.\d+)/ && print $1')
remoteVersion=$(fnm ls-remote | grep -E '.+v\d+\.\d+\.\d+' | tail -n 1 | perl -n -e '/^.*(v\d+\.\d+\.\d+)/ && print $1')
if [[ "$remoteVersion" != "$localVersion" ]]; then
echo Version "$remoteVersion" available
fnm use "$localVersion"
# shellcheck disable=SC2034
@aparajita
aparajita / notarize.sh
Last active Jun 1, 2021
Script to notarize a 4D plugin
View notarize.sh
#!/usr/bin/env bash
#
# $1 - Source plugin path, must be on a local filesystem
#
# DEPENDENCIES
#
# This script relies on jq, a JSON parser. You can download
# it at https://stedolan.github.io/jq, or install via package
# managers such as brew or apt.