Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Boyette Dyndrilliac

View GitHub Profile
@Dyndrilliac
Dyndrilliac / twos-complement.js
Created Mar 11, 2016 — forked from bsara/twos-complement.js
A simple function that returns the two's complement binary representation of a given number
View twos-complement.js
/**
* @param {Number} value
* @param {Number} [bitCount = 0]
*
* @returns {String} binary representation of the two's complement of `value`.
*/
function twosComplement(value, bitCount) {
let binaryStr;
if (value >= 0) {
@Dyndrilliac
Dyndrilliac / gist:a95f4b42bd4aab7ccda4
Created Mar 19, 2016 — forked from davidbalbert/gist:6815258
How to install custom SSL certificates on an ASUS RT-N66U running asuswrt-merlin
View gist:a95f4b42bd4aab7ccda4
# First, enable SSH in the Administration->System tab.
# Then log in to the device.
# Verify that https_crt_save is off
admin@RT-N66U:/tmp/home/root# nvram get https_crt_save
0
# Enable https_crt_save and verify that it was set correctly
admin@RT-N66U:/tmp/home/root# nvram set https_crt_save=1
admin@RT-N66U:/tmp/home/root# nvram get https_crt_save
@Dyndrilliac
Dyndrilliac / fix_drupal_settings_permissions.sh
Last active Nov 7, 2016
Frequently Used Commands for cen-4010-assignments
View fix_drupal_settings_permissions.sh
#!/bin/bash
#########################################
# Fix Drupal Settings Permissions #
# Author: Dyndrilliac (Matthew Boyette) #
# Date: 11/07/2016 #
#########################################
sudo chmod 755 /var/www/html/sites/default/settings.php
@Dyndrilliac
Dyndrilliac / git-duplicate.sh
Last active Nov 7, 2016
Frequently Used Commands for Git
View git-duplicate.sh
#!/bin/bash
#########################################
# Git Remote Duplication Script #
# Author: Dyndrilliac (Matthew Boyette) #
# Date: 09/10/2016 #
#########################################
git checkout master
git remote add drupal $1
git push drupal master
@Dyndrilliac
Dyndrilliac / MatthewStyle.xml
Created Nov 29, 2016
My Eclipse Java Formatting Settings
View MatthewStyle.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="Matthew" version="12">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
View PrimeTest.java
import api.util.Mathematics;
public class PrimeTest
{
public static void main(String[] args)
{
int n = -4;
StdOut.println(Mathematics.isEven(n)); // true
StdOut.println(Mathematics.isPrime(n)); // false
@Dyndrilliac
Dyndrilliac / data_init.js
Last active Apr 26, 2017
COP-4813-Final-Project
View data_init.js
const BASE_URL = "proxy/api/v2/"
const URLS = {
ENDPOINTS: BASE_URL,
DAYSOFWEEK: BASE_URL + "daysofweek/",
EQUIPMENT: BASE_URL + "equipment/",
EXERCISE: BASE_URL + "exercise/",
EXERCISEINFO: BASE_URL + "exerciseinfo/",
EXERCISECATEGORY: BASE_URL + "exercisecategory/",
EXERCISECOMMENT: BASE_URL + "exercisecomment/",
EXERCISEIMAGE: BASE_URL + "exerciseimage/",