Skip to content

Instantly share code, notes, and snippets.

View nixin72's full-sized avatar
🙃
Just messing around

Philip Dumaresq nixin72

🙃
Just messing around
  • Red Planet Labs
  • Montreal
View GitHub Profile
; Challenge from a friend:
;
; - Read a file of text
; - determine the n most frequently used words
; - print out a sorted list of those words along with their frequencies)
(-> filename
(slurp)
(lower-case)
(clojure.string/replace #"\d" "")
@nixin72
nixin72 / ignore.txt
Last active May 22, 2020 04:36
Some (hopefully) sane default file extensions that can be ignored while searching file contents for code
.exe
.App
.dll
.exe~
.zip
.gzip
.tar
.tgz
.tar.xz
.tar.gz
@nixin72
nixin72 / comp-348.md
Last active November 5, 2020 18:00
Quick guide on getting things set up for COMP-348

Guide to software for COMP-348

NOTE: As a heads up, I will not be adding to this gist anymore. I've written more detailed instructions for each language on the COMP-348 website, and you can find a lot more help on that website than what's available here.

Prolog

For Prolog, I highly recommend just using an online editor.

This editor allows you to do everything you would do by downloading a local Prolog environment, while giving you a likely more comfortable user interface than the terminal. It's very easy to use, when you open it up, you'll see a page that looks like this: swish Simply click on the Program button, and you'll be brought to a small text editor. On the left hand side is where you put all your facts and rules. For example, copy-paste this into the left-hand side:

@nixin72
nixin72 / databases.php
Created April 10, 2020 20:11
Some PHP copy/pasta for working with databases
<?php
/**
* Purpose:
* This class provides and easy to use API for accessing databases with a single
* method call. Create a DB connection, then run queries against that single
* connection easily.
*
* Attributes:
* - $host: string
* - $user: string
@nixin72
nixin72 / against-online-proctoring.md
Last active June 15, 2021 06:14
Proctored exams will not be tolerated

Dear Concordia University,

I am writing to you on behalf of the Concordia student body regarding the final exams and the decision to use online proctoring. We are urging you to change your decision about having online proctored exams. For many, this is an appalling invasion of privacy, a security risk, a demand for students to trade their morals for a grade, and discrimination against the less fortunate among the student body. In addition, over 7000 thousand Concordia students are against online proctoring.

  1. An invasion of privacy Forcing cameras and microphones into the homes of students is a violation of everyone's online privacy. For some, this might not be a huge concern, but for many others it's spying on
(defun new-sym (s1 s2)
(intern (concatenate 'string (string-upcase (string s1)) (string-upcase (string s2)))))
(defun make-key (str)
(values (intern (string-upcase str) "KEYWORD")))
(defun dup-and-key (rows)
(let ((data '()))
(loop for row in rows do
(setf data (cons row data))
Ruby 4 hrs 59 mins ████████████░░░░░░░░░ 57.2%
TypeScript 3 hrs 25 mins ████████▏░░░░░░░░░░░░ 39.2%
Org-mode 15 mins ▌░░░░░░░░░░░░░░░░░░░░ 3.0%
Emacs Lisp 2 mins ░░░░░░░░░░░░░░░░░░░░░ 0.6%
JSON 0 secs ░░░░░░░░░░░░░░░░░░░░░ 0.1%

Installing Windows Subsystem for Linux and integrating it in Visual Studio Code.

Before starting this, the first thing you need to do is make sure your Windows build is up to date enough.

  1. Open "Settings" -> "About"
  2. Scroll to "Windows Specification"
  3. Make sure OS build is 16215 or higher.

Check Windows build number

Enabling Windows Subsystem for Linux

  1. Run PowerShell as an administrator
@nixin72
nixin72 / KaTeX.css
Created April 14, 2019 05:57
My custom CSS added to GitHub's for KaTex to use when viewing markdown files
/*
GitHub default
*/
*{margin:0;padding:0;}
body {
font:13.34px helvetica,arial,freesans,clean,sans-serif;
color:black;
line-height:1.4em;
background-color: #F8F8F8;
padding: 0.7em;
@nixin72
nixin72 / ios-to-win-fileSorter.sh
Created April 14, 2019 05:55
Just a quick script that will take all of the XXXAPPLE directories when you import all your images from iOS into Windows and bring them all up into a top level directory so that you don't have to go through dozens or hundreds of folders yourself.
#!/bin/bash
cd $1
while read -r dir; do
cd $(pwd)"/"$dir
while read -r file; do
mv $(pwd)"/"$file $OLDPWD"/"$file
done < <(ls -l | grep -Pi "IMG_\d{4}.(MOV|JPG|PNG)" -o)