Skip to content

Instantly share code, notes, and snippets.

View realModusOperandi's full-sized avatar

Liam Westby realModusOperandi

  • IBM
  • Rochester, MN
View GitHub Profile
// Snippet of Gradle config to run the binary scanner
configurations {
binaryScanner
}
dependencies {
//...
binaryScanner 'com.ibm.websphere.appmod.tools:binary-app-scanner:22.0.0.1'
}
@realModusOperandi
realModusOperandi / App.java
Last active December 20, 2020 22:57
Downloads the code for fizzbuzz from Stack Overflow and runs it
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import javax.tools.JavaCompiler;
import javax.tools.ToolProvider;
@realModusOperandi
realModusOperandi / benchmark.c
Last active August 13, 2017 15:21
Byte Macintosh C Compiler Benchmark, Corrected
/* MINIMALLY UPDATED TO COMPILE UNDER LLVM. CHECK FIRST REVISION FOR UNEDITED VERSION */
/* sorting benchmark--calls randomly the number of times specified by MAXNUM
to create an array of long integers, then does a quicksort on the array of longs.
The program does this for the number of times specified by COUNT
*/
#include "stdio.h"
#define MAXNUM 100
def fart(strength):
print 'pbt' + 'bt'*strength
fart(1)
fart(5)
fart(10)
fart(100) //strips paint
@realModusOperandi
realModusOperandi / gist:8449066
Created January 16, 2014 02:52
PPM output (P6)
/* Write an image out to disk in PPM format (P6 variant).
* Will exit if file could not be opened for writing.
*
* the_image: Pointer to a ppm_image struct (see ppm.h) containing the image data to be written.
* outfilepath: String containing the file path that should be written to.
*/
void write_image(ppm_image *the_image, char *outfilepath) {
FILE *outfile;
if ((outfile = fopen(outfilepath, "w")) == NULL) {
fprintf(stderr, "There was a problem opening the output file %s.\n", outfilepath);
@realModusOperandi
realModusOperandi / 2fast2fizzbuzz.c
Last active November 9, 2022 07:46
May I present.... PARALLEL FIZZBUZZ (with no safeties).
//
// main.c
// 2fast2fizzbuzz
//
#include <stdio.h>
#include <pthread.h>
#include <sched.h>
typedef struct {
run:
Waiting for connections on Port #23657
A connection to a client is established!
Waiting for connections on Port #23657
UPLOAD coldjava.Test HTTP/1.1
Content-Length: 151
protocol: test
Compiling ...
#include <stdio.h>
#include <stdlib.h>
#include <GL/glfw.h>
#include <math.h>
// The basic idea of a vertex shader is that it takes in vertices, which have attributes
// like position and color, and does the operations specified in the shader's main method on them.
// It then passes the results of that on to the fragment shader.
// Holds the position and color of each vertex which will comprise the two triangles.
typedef struct {