Skip to content

Instantly share code, notes, and snippets.

@shivergard
shivergard / gist:6234562
Created August 14, 2013 19:21
YepNope Simple Domai.nr caller:
var dom=prompt("Doamin name");
url = 'http://domai.nr/api/json/info?callback=domlist&q=' + dom;
window.domlist = function (data){
console.log(data);
};
yepnope({test : true,
both : [url]
});
@shivergard
shivergard / gist:6238838
Last active December 21, 2015 02:59
YepNope App loading console
yepnope({
test : typeof $.lightbox_me == 'undefined',
yep : 'http://buckwilson.me/lightboxme/jquery.lightbox_me.js',
complete: function () {
if ($('#ocnsole_inputs').length == 1){
$('#ocnsole_inputs').remove();
}
if ($('#ocnsole_inputs').length == 0){
$('<input>').attr('type','text').attr('id','ocnsole_inputs').attr('name','ocnsole_inputs').appendTo('body');
}
@shivergard
shivergard / gist:6248358
Created August 16, 2013 08:58
YQL style dom mapping
console.clear();
function mapDOM(element, json) {
var treeObject = {};
// If string convert to document Node
if (typeof element === "string") {
if (window.DOMParser)
{
parser = new DOMParser();
docNode = parser.parseFromString(element,"text/xml");
@shivergard
shivergard / gist:7427211
Last active December 28, 2015 02:19
Create Quick Alias adding command
#!/bin/sh
if [ ! -f ~/.alias ]
then
echo "source ~/.alias" >> ~/.bashrc
echo "#This must stay at END" > ~/.alias
echo "alias realias='unalias -a;source ~/.alias'" > ~/.alias
echo "alias alias='nano ~/.alias;realias;'" >> ~/.alias
fi
@shivergard
shivergard / gist:7618077
Created November 23, 2013 18:15
PowerDNS add New Domains FAST
#!/bin/sh
if [ -z "$1" ]
then
echo "No domain defined"
exit
fi
echo ' '>> /etc/powerdns/bindbackend.conf
echo 'zone "'$1'" {' >> /etc/powerdns/bindbackend.conf
@shivergard
shivergard / gist:8038342
Created December 19, 2013 12:22
C Arguments
/* Hello World program */
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include "getopt32.c"
main(int argc, char **argv){
int opt;
@shivergard
shivergard / gist:8267401
Created January 5, 2014 11:51
Sublime 2 additional methods
[
{
"caption": "Undo",
"command": "undo"
},
{
"caption": "UberSearch",
"command": "show_panel",
"args": {
"panel": "find_in_files"
@shivergard
shivergard / gist:8395908
Created January 13, 2014 07:15
Sublime Text 2 php isset check snippet
<snippet>
<content><![CDATA[
isset(\$${1:this}) ? \$${1:this} : ''
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
@shivergard
shivergard / OpenVPN
Created January 16, 2014 20:02
Alias for OpenVPN
#Client List
alias cl='cat /var/log/openvpn-status.log | grep "10.8"'