Skip to content

Instantly share code, notes, and snippets.

$ cat a.py
#!/usr/bin/python3
import argparse
p = argparse.ArgumentParser()
p.add_argument('-a', action='store_true')
p.add_argument('-qa', nargs='?')
p.add_argument('-qb', nargs='?')
p.add_argument('command', nargs=argparse.REMAINDER)
@famzah
famzah / test.mjs
Created September 22, 2021 07:28
Prove that we can compare ArrayBuffer variables by casting them to a Uint8Array TypedArray view
// in regards to: https://github.com/inspect-js/node-deep-equal/issues/94
/* global console */
/* eslint-disable no-console */
/* global ArrayBuffer */
/* global Uint8Array */
/* global Float32Array */
/* global Float64Array */
/* global Uint32Array */
@famzah
famzah / fcgid_proc_unix.c
Created January 17, 2017 07:47
mod_fcgi: Excessive memory usage when large files are uploaded
#define FCGID_VEC_COUNT 8
apr_status_t proc_write_ipc(fcgid_ipc *ipc_handle,
apr_bucket_brigade *output_brigade)
{
apr_status_t rv;
struct iovec vec[FCGID_VEC_COUNT];
int nvec = 0;
apr_bucket *e;
for (e = APR_BRIGADE_FIRST(output_brigade);
@famzah
famzah / ABC.groovy
Last active August 29, 2015 14:09 — forked from jechlin/ABC.groovy
package com.onresolve.jira.groovy.jql
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.jql.query.QueryCreationContext
import com.atlassian.jira.util.MessageSet
import com.atlassian.query.clause.TerminalClause
import com.atlassian.query.operand.FunctionOperand
import org.apache.lucene.search.Query
class ABC extends AbstractScriptedJqlFunction implements JqlQueryFunction{