Skip to content

Instantly share code, notes, and snippets.

View alastairparagas's full-sized avatar

Alastair Paragas alastairparagas

View GitHub Profile
@alastairparagas
alastairparagas / gulpfile.js
Last active August 29, 2015 14:20
Perfect Gulpfile for all my current needs
/*global require, process, console */
(function () {
'use strict';
// Dependencies
var gulp = require('gulp'),
sass = require('gulp-sass'),
plumber = require('gulp-plumber'),
sourcemaps = require('gulp-sourcemaps'),
concat = require('gulp-concat'),
@alastairparagas
alastairparagas / toRead.md
Last active August 29, 2015 14:21
Technical books to read over the summer
  • June 14 Effective Javascript, Chapters 1-3

June 17-20

  • Programming PHP

  • Programming Javascript Applications

  • Functional Javascript

  • NodeJS Up and Running

@alastairparagas
alastairparagas / books.md
Last active October 8, 2017 19:43
High quality and highly recommended programming books and topics. This list will be updated frequently. Books for each programming language are arranged from beginner to expert-level difficulty.

Javascript

Javascript is a programming language that started out being the main language to "code" the web. It is used to build web apps and websites alongside HTML and CSS. However, it can now also be used to build server-side, desktop and hybrid mobile apps. Heck, it can even be used to program Arduino microcontroller boards!

  • Eloquent Javascript by Marijn Haverbeke
  • Javascript: The Good Parts by Douglas Crockford
  • The Principles of Object Oriented Javascript by Nicholas Zakas
  • Programming Javascript Applications by Eric Elliot
  • Speaking Javascript by Axel Rauschmayer
  • Javascript Enlightenment by Code Lindley
  • You Don't Know JS (series) by Kyle Simpson
@alastairparagas
alastairparagas / StorageAccess.factory.spec.js
Created May 28, 2015 23:28
A sample unit test on an AngularJS factory involving Firebase. The factory being unit tested abstracts Firebase away as a storage service from the rest of the app.
/*global describe, beforeEach, it, expect */
(function (window) {
'use strict';
var angular = window.angular,
MockFirebase = window.MockFirebase,
Firebase = window.Firebase,
jasmine = window.jasmine;
MockFirebase.override();
@alastairparagas
alastairparagas / .bash_profile
Created August 23, 2015 19:34
Bash Profile for my Mac OSX
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
# Source: kirsle.net/wizards/ps1.html
export PS1="\[$(tput setaf 2)\][\W]\[$(tput setaf 1)\]\$(parse_git_branch) \[$(tput sgr0)\]"
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
@alastairparagas
alastairparagas / Calculator.java
Created September 8, 2015 01:08
Fibonacci calculator - O(logN)
/*******************************************************
Program Number: A1_1
Purpose/Description: <a brief description of the program>
Author: Alastair Paragas
Due date: 09/09/2015
Certification:
I hereby certify that this work is my own and none of it is the work of
any other person.
Alastair Paragas
*******************************************************/
@alastairparagas
alastairparagas / LastSurvivor.java
Created October 3, 2015 02:39
Josephus Problem
/*******************************************************
Program Number: A2_1
Purpose/Description: Deletes every kth element in a circular array until
there is only 1 element left standing.
Author: Alastair Paragas
Due date: 10/02/2015
Certification:
I hereby certify that this work is my own and none of it is the work of
any other person.
Alastair Paragas
import socket
import sys
import mimetypes
import threading
import os
import time
def getFileMimetype(absoluteFilePath):
"""
Gets the HTTP mime type of a file located at provided file path
@alastairparagas
alastairparagas / exchange.py
Created July 18, 2016 15:20
Testing in Python, with Pytest and Mock
import time
import channels
import django.conf
import pydash as _
import json
import re
import gevent
class Exchange(object):
{-
Exercise 1
Define the functions
toDigits :: Integer -> [Integer]
toDigitsRev :: Integer -> [Integer]
toDigits should convert positive Integers to a list of digits. (For 0
or negative inputs, toDigits should return the empty list.)
toDigitsRev should do the same, but with the digits reversed.
-}
toDigits :: Integer -> [Integer]