Skip to content

Instantly share code, notes, and snippets.

View gopperman's full-sized avatar

Greg Opperman gopperman

View GitHub Profile
wget https://github.com/downloads/pooler/cpuminer/pooler-cpuminer-2.2.3-linux-x86_64.tar.gz
tar -xvzf pooler-cpuminer-2.2.3-linux-x86_64.tar.gz
# Replace USER, ID & PASS with your creds setup on http://litecoinpool.org/account
echo "nohup nice -n 20 ./minerd --url http://litecoinpool.org:9332/ --userpass USER.ID:PASS" > litecoin.sh
chmod a+x litecoin.sh
./litecoin.sh &
# Find thir process
# ps axl | grep lite
jQuery(document).ready(function() {
jQuery.fn.cleardefault = function() {
return this.focus(function() {
if( this.value == this.defaultValue ) {
this.value = "";
}
}).blur(function() {
if( !this.value.length ) {
this.value = this.defaultValue;
}
@gopperman
gopperman / gist:6166280
Last active December 20, 2015 17:09
These Wordpress filters demonstrate two methods to publish (and view) posts in the future. Great for events, etc.
add_filter( 'wp_insert_post_data', 'publish_future' );
/* Avoid publishing posts as 'future' in the first place.
function publish_future( $data ) {
if ( $data['post_status'] == 'future' && $data['post_type'] == 'post' )
$data['post_status'] = 'publish';
return $data;
}
@gopperman
gopperman / gist:6428458
Created September 3, 2013 19:30
Javascript function suicide - have a function kill itself so that it only runs once
var init = function () {
// do the initializing
init = function() {
return false;
}
};
@gopperman
gopperman / gist:7418121
Last active December 28, 2015 01:09 — forked from anonymous/gist:7418114
JQuery in-page Smooth Scrolling
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

<!--
How to load Font Awesome asynchronously
Use: Just put this script on the bottom/footer of your web
-->
<script type="text/javascript">
(function() {
var css = document.createElement('link');
css.href = '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css';
css.rel = 'stylesheet';
@gopperman
gopperman / jquery.megadropdowns
Last active August 29, 2015 14:01
JQuery function to load mega dropdowns
function loadRichMenus() {
if ($( document ).width() > 1179) {
$('.dropdown-product').each(function() {
if (!$(this).data("loaded")) {
$('.dd-container', this).load($(this).data('url'), function(){
});
$(this).data("loaded", true);
}
});
@gopperman
gopperman / shopify.cart
Created May 16, 2014 01:09
Javascript for a quick cart view / add in shopify
var Shopify = Shopify || {};
jQuery(function($) {
Shopify.shop = "redacted.url";
Shopify.onCartUpdate = function(cart) {
$.getJSON('/cart.js', function (cart, textStatus) {
$('.cartcount').each(function() {
$(this).html(cart.item_count);
});
if (cart.item_count == 0) {
@gopperman
gopperman / gitsubmodules.md
Last active September 7, 2015 15:56
Just some basic commands for git submodules

Add a submodule

git submodule add https://github.com/chaconinc/DbConnector

Pull each submodule

git submodule foreach git pull origin master