Skip to content

Instantly share code, notes, and snippets.

View EvanLovely's full-sized avatar

Evan Lovely EvanLovely

View GitHub Profile
@EvanLovely
EvanLovely / sql-sync-with-no-remote-drush.sh
Created September 27, 2013 23:49
It's like drush sql-sync for a Drupal site, but there's no drush installed on the remote server.
# Author: Evan Lovely
# Syncs the database and files from the live production site to here. Run it anywhere with `sh sync--prod->stage.sh`
# Needs to be an absolute path
LOCAL_PATH=""
SSH="[email protected]"
DB_USER=""
DB_PASS=""
DB=""
REMOTE_PATH=""
@EvanLovely
EvanLovely / no-drush-on-server.aliases.drushrc.php
Created September 25, 2013 02:01
Drush alias for a server that doesn't have drush installed. Helps considerably when pushing and pulling databases and files for a Drupal site as it uses mysqldump, ssh, and rsync instead of drush (which is usually required for parsing the settings.php file and finding out what is set below.
$aliases['prod'] = array(
'root' => '',
'uri' => '',
'remote-user' => '',
'remote-host' => '',
'ssh-options' => '-o PasswordAuthentication=yes',
'path-aliases' => array(
'%files' => 'sites/default/files',
),
'databases' =>
// Make elements align in a grid, regardless of height
// Apply to elements you want as grid items
// $cols = how many columns you want
// $margin-right = margin-right, should be in percent
// $ie8-height = an explicit height for all the elements, "off" by default, only applied to IE
@mixin gridify($cols, $margin-right: 5%, $ie8-height: auto) {
// Math for widths, margins, and clears
$width: (100% / $cols) - $margin-right + ($margin-right / $cols);
$ie-width: (100% / $cols) - $margin-right;
$clearnum: $cols + 1;
@EvanLovely
EvanLovely / search-bash-aliases.sh
Created September 4, 2013 18:36
Bash Function to search through your Bash Aliases and Functions and display helpful text in the prompt.
# search bash aliases
sba() {
cat ~/.bash_aliases | grep -i -A 1 "^#.*$*"
cat ~/.bash_aliases | grep -i -B 1 "^alias.*$*"
cat ~/.bash_functions | grep -i -A 1 "^#.*$*"
}
@EvanLovely
EvanLovely / Mixin:-Arrow.markdown
Created August 29, 2013 07:06
A Pen by Evan Lovely.
@EvanLovely
EvanLovely / config.rb
Created August 22, 2013 02:42
SASS/Compass Simple Compile Error Beep for Mac. To hear a sample, run this in Terminal: `afplay /System/Library/Sounds/Basso.aiff`
# Play sound Basso upon error
on_stylesheet_error do
system('afplay /System/Library/Sounds/Basso.aiff')
end
#!/usr/bin/ruby
# Convert a Markdown README to HTML with Github Flavored Markdown
# Github and Pygments styles are included in the output
#
# Requirements: json gem (`gem install json`)
#
# Input: STDIN or filename
# Output: STDOUT
# Arguments: "-c" to copy to clipboard (or "| pbcopy"), or "> filename.html" to output to a file
# cat README.md | flavor > README.html
@EvanLovely
EvanLovely / index.html
Created August 8, 2013 17:42
A CodePen by Evan Lovely. Custom Checkbox & Radio Form Elements - Making the checkbox & radio look spiffy with CSS3 :)
<input type="checkbox"><br />
<input type="checkbox" checked="true">
<hr />
<input type="radio" name="radio"><br />
<input type="radio" name="radio" checked="true>
@EvanLovely
EvanLovely / checkboxes
Created August 3, 2013 00:19
Fancy CSS3 Checkboxes (for Drupal Markup)
.form-type-checkbox {
padding-left: 18px;
padding-right: 2px;
position: relative;
>input {
position: absolute;
left: 0;
top: 4px;
top: 0\9;
@EvanLovely
EvanLovely / applescript_command-tab
Last active October 29, 2021 23:17
Applescript: Command Tab
tell application "System Events"
key down command
keystroke tab
key up command
end tell