Skip to content

Instantly share code, notes, and snippets.

View rajdeep26's full-sized avatar

Rajdeep Mandrekar rajdeep26

View GitHub Profile
@emad-elsaid
emad-elsaid / share-screen.rb
Created February 22, 2014 10:30
share your screen on the local network
require 'socket'
require 'base64'
Refresh = 1 # seconds to refresh image on server
screen_capture_command = 'screencapture -C -x tmp.png'
image = ''
latest = Time.now
server = TCPServer.new 3000
loop do
@neilsoult
neilsoult / LazyLoad.js
Created October 31, 2013 19:40
LazyLoad directive for loading external javascript for AngularJs. In this example, I use google maps' API as the external library being loaded
angular.module('testApp', []).
directive('lazyLoad', ['$window', '$q', function ($window, $q) {
function load_script() {
var s = document.createElement('script'); // use global document since Angular's $document is weak
s.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize';
document.body.appendChild(s);
}
function lazyLoadApi(key) {
var deferred = $q.defer();
$window.initialize = function () {
@mapbutcher
mapbutcher / Postgresql-module-install
Created October 23, 2013 01:48
Notes on how to install a missing module from PostgreSQL
#Notes on how to install a missing module from PostgreSQL
#Download and Postgresql (no need to make install because we already have it..):
#pre-requisites
sudo apt-get install gcc
sudo apt-get install libreadline-dev
sudo apt-get install zlib1g-dev
wget http://ftp.postgresql.org/pub/source/v9.3.0/postgresql-9.3.0.tar.gz
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@sacreman
sacreman / gist:4453493
Created January 4, 2013 15:32
haproxy config
global
log 127.0.0.1 local2 info
pidfile /var/run/haproxy.pid
stats socket /var/run/haproxy.stat mode 600 level admin
#debug
defaults
mode http
log global
@davetromp
davetromp / UpOrDown.sh
Created November 28, 2012 22:29
Bash script that checks if a site is up or down and emails notifications
#!/bin/bash
################################################################################
# This script will check to see if a website is up/down by pinging the url
# If there is no response an email wil be send via an external smtp mail server
# If the site status is down an email will be send when the site is up again
# set your check interval here :-) #############################################
interval=3600 # hour
@mjrich
mjrich / README.md
Created November 6, 2012 04:48 — forked from nikhilrajendra/README.md
Thanking friends who wishes for your birthday