Skip to content

Instantly share code, notes, and snippets.

View seanbuscay's full-sized avatar

Sean Buscay seanbuscay

View GitHub Profile
@seanbuscay
seanbuscay / remove file
Created May 16, 2013 15:54
Shell commands to remove Files #shell
rm command syntax
rm (short for remove) is a Unix / Linux command which is used to delete files from a filesystem. Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). The syntax is as follows:
rm -f -r {file-name}
Where,
-f: Forcefully remove file
-r: Remove the contents of directories recursively
@seanbuscay
seanbuscay / Selenium_find_font_weight
Created June 10, 2013 00:20
Selenium find font weight.
Command: assertEval
Target: var x = window.document.querySelector('body.home.es ul'); window.getComputedStyle(x,null).getPropertyValue('font-weight');
Value: 700
@seanbuscay
seanbuscay / strip_classes.php
Created September 23, 2013 16:16
function to remove classes on tags. Note will fail if body tag has a class in it. See: http://stackoverflow.com/questions/1170912/strip-all-classes-from-p-tags
$html=preg_replace('/class=".*?"/', '', $html);
<?php
/**
 *
 * @strip a single HTML/XML tag from a string
 *
 * @param array $tags The tags to strip
 *
 * @param string The string to strip from
 *
@seanbuscay
seanbuscay / git_remote_prune.sh
Created October 8, 2013 18:29
cleanup remote branches list. the dry run shows you what it will do. withouth the flag it will run the clean up.
git remote prune origin --dry-run
@seanbuscay
seanbuscay / if_file_exists.sh
Created July 29, 2013 15:05
Check if file existsd
#!/bin/bash
FILE=$1
 
if [ -f $FILE ];
then
echo "File $FILE exists"
else
echo "File $FILE does not exists"
fi
; Create a Tar of All in Directory
tar cvf backup.tar . 
; Untar
 tar xvf filename.tar
; Exclude files
@seanbuscay
seanbuscay / vue.html
Created February 25, 2017 19:26
How to use Vue Moment
<div id="app">
<ul>
<li v-for="item in items">
<p>{{ moment(item).format('MMMM Do YYYY, h:mm:ss a') }}</p>
<p class="method">{{ date(item) }}</p>
<p class="filter">{{ item | moment }}</p>
</li>
</ul>
</div>
@seanbuscay
seanbuscay / non-stick-footer.js
Last active September 7, 2018 17:55
A js option to push a web page footer to the bottom of the page, but not have it act as a sticky footer.
{% spaceless %}{{ content.field_story_program_name|render|trim }}{% endspaceless %}