Skip to content

Instantly share code, notes, and snippets.

Avatar

Raffi Khatchadourian khatchad

View GitHub Profile
View persona.md

Jack, a primary school teacher

Jack, age 32, is a primary school teaching ...

Scenarios

Fishing in Ullapool

Jack is a primary school teacher in Ullapool, teaching P6 pupils. He has decided that a class project ...

@khatchad
khatchad / mysql_backup.sh
Created Jan 14, 2021
MySQL backup script
View mysql_backup.sh
#!/bin/bash
USER=""
PASSWORD=""
OUTPUT="$HOME/backup"
DATABASES=("skeletal_implementers" "phpmyadmin" "skeletal_implementers_abstract_only")
MYSQL_DUMP="/opt/bitnami/mysql/bin/mysqldump"
REMOTE_DIR="ftp://websupport1.citytech.cuny.edu/backup/"
REMOTE_USER=""
REMOTE_PWD=""
@khatchad
khatchad / doc2md.sh
Created Nov 23, 2020
Converts doc files to GitHub flavored markdown in ASCII
View doc2md.sh
#!/bin/bash
INPUT=$1
OUTPUT=$2
/usr/bin/pandoc "$INPUT" -t gfm --wrap=none | /usr/bin/uni2ascii -B > "$OUTPUT"
View gist:93533192b4ea89eb67bd0ef8d217bb45
OpenGL vendor string: X.Org
OpenGL renderer string: AMD Radeon (TM) Pro WX Series (POLARIS11, DRM 3.33.0, 5.3.0-29-generic, LLVM 9.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 19.2.8
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5 (Compatibility Profile) Mesa 19.2.8
OpenGL shading language version string: 4.50
OpenGL context flags: (none)
@khatchad
khatchad / perf.patch
Last active Aug 21, 2018
Conversion of JUnit tests to JMH tests for java-design-patterns
View perf.patch
diff --git a/abstract-document/src/test/java/com/iluwatar/abstractdocument/AbstractDocumentTest.java b/abstract-document/src/test/java/com/iluwatar/abstractdocument/AbstractDocumentTest.java
index b6467e232..aef824817 100644
--- a/abstract-document/src/test/java/com/iluwatar/abstractdocument/AbstractDocumentTest.java
+++ b/abstract-document/src/test/java/com/iluwatar/abstractdocument/AbstractDocumentTest.java
@@ -23,11 +23,18 @@
package com.iluwatar.abstractdocument;
import org.junit.Test;
+import org.openjdk.jmh.annotations.Benchmark;
+import org.openjdk.jmh.annotations.Level;
View integers.cpp
#include <iostream>
#include <climits>
using namespace std;
int main() {
int i;
int j;
int result;
cout << "Enter i: ";
View integers.cpp
#include <iostream>
#include <climits>
using namespace std;
int main() {
int i;
int j;
int result;
cout << "Enter i: ";
@khatchad
khatchad / mann-whitney.r
Created Nov 13, 2017
R script to generate the Mann-Whitney statistical analysis for our pull request study
View mann-whitney.r
changed_files_non_merged <- c(1, 5, 6, 16, 16, 22, 23, 29, 51, 135)
changed_files_merged <- c(2, 4, 4, 21)
changed_lines_non_merged <- c(22,27,62,729,681,283,161,413,922,2528)
changed_lines_merged <- c(23,53,441,526)
concrete_non_merged <- c(1,1,0,0,0,0,1,0,0,0)
concrete_merged <- c(0,1,0,0)
KLOC_non_merged <- c(25,7,20,309,244,136,154,329,1266,506)
@khatchad
khatchad / Util.java
Created Feb 23, 2017
Find out if a object creation instruction produces an instance with the given instance key in WALA
View Util.java
/**
* True iff the given {@link InstanceKey} corresponds with the given
* {@link SSAInvokeInstruction} in the given {@link CallGraph}. In other
* words, the result is true iff the instruction is used to create the
* instance.
*
* @param instanceKey
* An instance in question.
* @param instruction
* An instruction in question. Should be corresponding to a ctor
View creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown