This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* version1: convert online image | |
* @param {String} url | |
* @param {Function} callback | |
* @param {String} [outputFormat='image/png'] | |
* @author HaNdTriX | |
* @example | |
convertImgToBase64('http://goo.gl/AOxHAL', function(base64Img){ | |
console.log('IMAGE:',base64Img); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Writing JS for everything is great and all, but I don't want to see JS | |
// inline in my Jade templates. Thankfully, there are ways of abstrating it | |
// into mixins! | |
// Want some Rails-like helpers? | |
mixin link_to(name, href) | |
- href = href || "#" | |
a(href="#{href}")= name | |
// How about a single editing point for a class name? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you have this error: Unknown SSL error -12218 mapped to net::ERR_SSL_PROTOCOL_ERROR | |
and your upwork client does not run you need: | |
sudo apt-get install libnss3=2:3.15.4-1ubuntu7 libnss3-nssdb=2:3.15.4-1ubuntu7 | |
sudo apt-mark hold libnss3 libnss3-nssdb | |
Solution provided by Ilya E from upwork. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(a,b){a.MixItUp.prototype.addAction("_constructor","pagination",function(){var b=this;b.pagination={limit:0,loop:!1,generatePagers:!0,maxPagers:5,pagerClass:"",prevButtonHTML:"«",nextButtonHTML:"»"},a.extend(b.selectors,{pagersWrapper:".pager-list",pager:".pager"}),a.extend(b.load,{page:1}),b._activePage=null,b._totalPages=null,b._$pagersWrapper=a()},1),a.MixItUp.prototype.addAction("_init","pagination",function(){var a=this;a._activePage=1*a.load.page,a.pagination.maxPagers="number"==typeof a.pagination.maxPagers&&a.pagination.maxPagers<5?5:a.pagination.maxPagers},1),a.MixItUp.prototype.addAction("_bindHandlers","pagination",function(){var b=this;b.pagination.generatePagers&&(b._$pagersWrapper=a(b.selectors.pagersWrapper)),b.controls.live?b._$body.on("click.mixItUp."+b._id,b.selectors.pager,function(){b._processClick(a(this),"page")}):b._$pagersWrapper.on("click.mixItUp."+b._id,b.selectors.pager,function(){b._processClick(a(this),"page")})},1),a.MixItUp.prototype.addAction("_processClick |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Adjusted to give override background and text colour */ | |
.highlight pre, pre, .highlight .hll { | |
background-color: #49483E; | |
border: 1px solid #ccc; | |
padding: 6px 10px; | |
border-radius: 3px; | |
color: #FFFFFF; | |
} | |
/* Highlights taken from https://gist.github.com/asaaki/1007420 for Monokai theme */ | |
.c { color: #75715e } /* Comment */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ====================================================== | |
This script is NOT FULLY TESTED (not tested on Windows Server either) | |
USE AT YOUR OWN RISK - development environment Ubuntu Linux 14.04.3 LTS | |
The purpose of this script is for small websites and blogs | |
to have their existing media to work through Amazon S3 | |
There's a great plugin, WP Offload S3, that we'll be tapping | |
into...it works great for new media, but this is a quick |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###################### | |
# - Conky settings - # | |
###################### | |
update_interval 1 | |
total_run_times 0 | |
net_avg_samples 1 | |
cpu_avg_samples 1 | |
imlib_cache_size 0 | |
double_buffer yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Digital Ocean | |
# Ubuntu 12.04 x64 Server | |
# Open VPN | |
echo "Select on option:" | |
echo "1) Set up new PoPToP server AND create one user" | |
echo "2) Create additional users" | |
read x | |
if test $x -eq 1; then | |
echo "Enter username that you want to create (eg. client1 or john):" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Count number of widgets in a sidebar | |
* Used to add classes to widget areas so widgets can be displayed one, two, three or four per row | |
*/ | |
function slbd_count_widgets( $sidebar_id ) { | |
// If loading from front page, consult $_wp_sidebars_widgets rather than options | |
// to see if wp_convert_widget_settings() has made manipulations in memory. | |
global $_wp_sidebars_widgets; |