Skip to content

Instantly share code, notes, and snippets.

View malditha's full-sized avatar
🎯
Focusing

Kris malditha

🎯
Focusing
View GitHub Profile
@malditha
malditha / clearRAM.sh
Created October 22, 2015 21:43 — forked from pklaus/clearRAM.sh
A Script to Clear Cached RAM on Linux
#!/bin/bash
## Bash Script to clear cached memory on (Ubuntu/Debian) Linux
## By Philipp Klaus
## see <http://blog.philippklaus.de/2011/02/clear-cached-memory-on-ubuntu/>
if [ "$(whoami)" != "root" ]
then
echo "You have to run this script as Superuser!"
exit 1
fi
@malditha
malditha / gist:6298270e68ad60c0d5e7
Created September 22, 2015 21:11 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@malditha
malditha / gist:b03d8e10376f8e7487ae
Last active August 29, 2015 14:27 — forked from corsonr/gist:9152652
WooCommerce : add custom fields to product variations
<?php
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_process_product_meta_variable', 'save_variable_fields', 10, 1 );
/**
@malditha
malditha / twitter.js
Last active August 29, 2015 14:23 — forked from ArupSen/twitter.js
function twitterCallback2(twitters) {
var statusHTML = [];
for (var i=0; i<twitters.length; i++){
var username = twitters[i].user.screen_name;
var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
return '<a href="'+url+'">'+url+'</a>';
}).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
return reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'">'+reply.substring(1)+'</a>';
});
statusHTML.push('<li><span>'+status+'</span> <a style="font-size:85%" href="http://twitter.com/'+username+'/statuses/'+twitters[i].id_str+'">'+relative_time(twitters[i].created_at)+'</a></li>');
@font-face{font-family:fontello;src:url(../fonts/entypo-combined/entypo.eot?94568459);src:url(../fonts/entypo-combined/entypo.eot?94568459#iefix) format('embedded-opentype'),url(../fonts/entypo-combined/entypo.woff?94568459) format('woff'),url(../fonts/entypo-combined/entypo.ttf?94568459) format('truetype'),url(../fonts/entypo-combined/entypo.svg?94568459#fontello) format('svg');font-weight:400;font-style:normal}.application-deadline.expired:before,.application-deadline.expiring:before,.application-deadline:before,.candidate-dashboard-action-edit:before,.entry-content #job-manager-book-marks ul.job-manager-bookmark-actions li:after,.filter_wide.filter_by_tag a.active:before,.footer-social a:before,.has-select .select:before,.job-dashboard-action-edit:before,.job-dashboard-action-mark_filled:before,.job-dashboard-action-mark_not_filled:before,.load_more_jobs:before,.nav-menu-primary li.has-children>a:after,.resume-file:before,.resume-link a:before,.showing_jobs .alert:before,.showing_jobs .reset:before,.showin