Skip to content

Instantly share code, notes, and snippets.

Avatar

Aparajita Fishman aparajita

View GitHub Profile
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 / 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
@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 **
@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() {
@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
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 / notarize.sh
Last active Mar 24, 2021
Script to notarize a 4D plugin
View notarize.sh
#!/usr/bin/env bash
#
# $1 - Source plugin path, must be on a local filesystem
#
# HOW TO USE
#
# To use this script, you need to set three environment variables.
# The easiest way to do this is to export them from .bashrc or .zshrc,
# depending on which shell you use. Add these three lines to your
@aparajita
aparajita / upgrade-node.sh
Last active Oct 18, 2020
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
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