Skip to content

Instantly share code, notes, and snippets.

View chrissnyder2337's full-sized avatar

Chris Snyder chrissnyder2337

View GitHub Profile
test contents
@chrissnyder2337
chrissnyder2337 / whiteboardCleaner.md
Created August 14, 2019 20:34 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@chrissnyder2337
chrissnyder2337 / mymodule.css
Created February 19, 2018 18:31 — forked from AlexSkrypnyk/mymodule.css
Drupal 'add more' and 'remove single' AJAX buttons on multi value custom field using FormAPI
input.form-submit.button-small {
padding: 4px 8px;
font-weight: bold;
}
.container-inline input.form-submit.button-small + .ajax-progress.ajax-progress-throbber .throbber {
position: absolute;
left: 19px;
margin-top: 7px;
}
@chrissnyder2337
chrissnyder2337 / Install_Phpstorm.sh
Created December 5, 2016 16:45 — forked from theodorosploumis/Install_Phpstorm.sh
Update phpstorm on Ubuntu linux.
#!/bin/bash -e
# IMPORTANT. My phpstom installation exists on /opt/phpstorm.
# IMPORTANT. Run with sudo!
# Early Access program: https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program
echo -n "Please enter the PhpStorm download url (eg http://download.jetbrains.com/webide/PhpStorm-EAP-141.690.tar.gz): "
read url
# Download file from url
echo "Downloading PhpStorm to ~/Desktop"

Keybase proof

I hereby claim:

  • I am chrissnyder2337 on github.
  • I am chrissnyder (https://keybase.io/chrissnyder) on keybase.
  • I have a public key whose fingerprint is 4BF6 C678 A6E0 B0DB 9109 E711 2E70 D442 5971 D28D

To claim this, I am signing this object:

  1. use hook_form_alter to modify $items['user/%user/edit']['page callback'] and add my call back.
  2. In the new callback, update to the user entity (and save it to the global $user). Then call the original drupal_get_form
<?php
$aliases['ausa.local'] = array(
'uri' => 'ausa.local',
'root' => '/var/www/ausa.local/web',
);
$aliases['ausa.utdev.com'] = array(
'uri' => 'ausa.utdev.com',
'root' => '/srv/www/ausa.utdev.com/web',
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
<?php
$userCurrentCommittees = array(); // from drupal user
$agciUpdatedCommittees = array(); // from acgi
$committeesToRemove = $userCurrentCommittees;
foreach ($agciUpdatedCommittees as $committee){
// * run_update_committee_method
if (in_array($committee, $userCurrentCommittees)) {
@chrissnyder2337
chrissnyder2337 / updateBodyImageClass.php
Created March 25, 2015 16:38
Add a class to the first image field of all blog articles on a Drupal 7 site.
<?php
/**
* Created by PhpStorm.
* User: chris
* Date: 3/25/15
* Time: 11:44 AM
*/
# Bootstrap start
define('DRUPAL_ROOT', '.');