Skip to content

Instantly share code, notes, and snippets.

Continue Reading...
Posted by Andrew Grimm on 4 Oct 2013
Design Contest for www.ruby-lang.org
The Ruby Association will be hosting a design contest for the new design of ruby-lang.org.
@iandesj
iandesj / capture.py
Created April 28, 2015 02:45
capture.py - file containing methods from the pi_safe_notify python module I made for my senior capstone project
from Capture import *
import time
import subprocess
# Generic method, returns time stamp used for file indication (date and time)
def capture_stamp(type):
import os
if type == 'video':
path, dirs, files = os.walk("/home/pi/Desktop/pi_safe_notify/Videos/5423DMX$/").next()
@iandesj
iandesj / somegist.ps1
Last active August 25, 2016 04:07
xml manip
$file_path = "C:\the_xml.xml"
$xml = [xml](Get-Content $file_path)
$xml.User.Role.value # retrieve value from <User><Role value="foobar"></User></Role>
$xml.User.Role.value = "lets update this" # change the contents of value
# lots of other cool stuff
$xml.save($file_path) # then save it, like a champ
diff --git a/LOTS/LOTS.Web/app/shared/search/common-search/common-search.component.html b/LOTS/LOTS.Web/app/shared/search/common-search/common-search.component.html
index 2b40150..3c74b2d 100644
--- a/LOTS/LOTS.Web/app/shared/search/common-search/common-search.component.html
+++ b/LOTS/LOTS.Web/app/shared/search/common-search/common-search.component.html
@@ -91,7 +91,7 @@
<div class="col-sm-12">
<div class="btn-group pull-right">
<button type="button" class="btn btn-default" (click)="resetForm()">Reset</button>
- <button #btnSubmit [disabled]="pristineInvalid" class="btn btn-primary" (click)="submitSearch(searchForm)">Submit</button>
+ <button #btnSubmit [disabled]="isSubmitDisabled()" class="btn btn-primary" (click)="submitSearch(searchForm)">Submit</button>
@iandesj
iandesj / cleanup.bat
Created December 5, 2017 17:58
Cleanup code
cleanupcode.exe /p=LOTS-Solution /s="$env:AppData\JetBrains\Shared\vAny\GlobalSettingsStorage.DotSettings" "$env:USERPROFILE\Source\Repos\lots-solution\LOTS\LOTS.sln" --include=".\$("$(git diff --name-only origin/master...)
".split(" ") -like "*.cs" -replace "^LOTS", "**" -join ";")"
@iandesj
iandesj / comfortable-swipe.conf
Created June 5, 2018 00:48
/usr/local/share/comfortable-swipe/comfortable-swipe.conf
# Comfortable Swipe converts touchpad swipe gestures to keyboard commands. You
# may edit this configuration file if you have different keyboard shortcuts
# that you would like to use. You can ignore a gesture by commenting out with
# a pound(#) symbol.
#
# Refer to https://www.linux.org/threads/xdotool-keyboard.10528/ for a list of
# keycodes you can use.
#################
# MISCELLANEOUS #
@iandesj
iandesj / user_role_migration.py
Last active June 26, 2018 20:22
Script for membership and user tables for LOTS
#!/usr/bin/env python
# Author: Ian Des Jardins
# Date: 06/26/2018
import sys
from datetime import date
def find_line_and_values(lines, file_cursor):
line = ''
line_count = 1
yum install epel-release -y && yum install gcc python2-devel python-pip upx -y
yum install git -y
git clone https://github.com/akroma-project/akroma-masternode-management.git && cd akroma-masternode-management/source
pip install -r requirements.txt
pyinstaller --onefile --noconfirm --clean --log-level=WARN --strip --runtime-tmpdir /dev/shm akroma-mn-setup.py
pyinstaller --onefile --noconfirm --clean --log-level=WARN --strip --runtime-tmpdir /dev/shm akroma-mn-utils.py
./dist/akroma-mn-setup -h
yes | ./dist/akroma-mn-setup
@iandesj
iandesj / naming.js
Created July 16, 2019 14:39
Variable & Function Naming
// before good naming
const user = getActiveUser();
const peopleData = fetchData();
function beginProc(data) {}
const d = new Date();
class CatRepository {
@iandesj
iandesj / booleans.js
Created July 16, 2019 14:40
Named Boolean Expressions
// before named boolean expressions
// check if the user is active and if the user has
// dependents
if (user.status === 'active' &&
user.dependents.length > 1) {
// perform something important
}
// before
if (!user.authenticated) {