Skip to content

Instantly share code, notes, and snippets.

View santosh's full-sized avatar
:octocat:

Santosh Kumar santosh

:octocat:
View GitHub Profile
@santosh
santosh / .gitconfig
Last active October 9, 2015 06:27
My .gitconfig file
[core]
editor = vii # See : http://unix.stackexchange.com/a/45877/22240
whitespace = nowarn
pager = less
diff = vimdiff
excludesfile = ~/.gitignore_global
[user]
name = # Santosh Kumar
email = # {Email Here}
[github]
@santosh
santosh / gist:3847486
Created October 7, 2012 08:03
JavaScript: Prevent email ID to be harvested by bots
// it will only work until harvester is a crawler
// "human" harvesters can't be prevented from this
//
// write your email address and put some extra weird
// characters in it, e.g. mymailNOSPAM@gmail.com
// now replace your weird characters with "nothing".
var link = document.getElementById('email');
link.href = link.href.replace(/NOSPAM/,'');
link.title = link.title.replace(/NOSPAM/,'');
@santosh
santosh / gist:3847513
Created October 7, 2012 08:19
JavaScript: Method #1: Randomize elements on a page
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<title>Randomize Element</title>
<style type="text/css" media="screen">/* mininal style {{ */
html, body { height: 100%; overflow: hidden;}
@santosh
santosh / gist:3847532
Created October 7, 2012 08:31
JavaScript: Method #2: Randomize elements on a page
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<title> Randomise Element's Position </title>
<style type="text/css" media="screen">
.randomizeme {
position:absolute;
@santosh
santosh / ChangeLink.html
Last active December 10, 2015 12:18
JavaScript: An example of changing link on the time when user clicks on it..
@santosh
santosh / ImageReflection.html
Created January 3, 2013 05:10
CSS: CSS technique to make image reflectionss
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" media="screen" href="reflection.css" />
<title> Image Reflection </title>
</head>
<body>
@santosh
santosh / downloadDirectlyToServer.php
Last active December 10, 2015 17:28
PHP: A PHP script to download files directly download files to webserver. This can help prevent your bandwidth of both end user and the webserver in situations like downloading WordPress to your computer then uploading to server. [Its just the case, WordPress like scripts are already included in some hosting plans ;)].
<?php
/*
Please make sure that you already create a file that you are setting in $saveas variable,
and set its permission to 777 else you can receive an error telling you like permission
denied etc.
*/
// file to open and save to
$saveas = "capitalizr.py.zip";
@santosh
santosh / flickrScreen.html
Created January 7, 2013 04:02
JavaScript: Changes CSS value on a regular interval of time. This example will show how to change background color of body every 1 second
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Random Color Generator in JavaScript </title>
<script type="text/javascript" charset="utf-8">
// generate random color
function colorname() {
@santosh
santosh / dencoder.html
Created January 11, 2013 05:28
JavaScript: URL dencoder is an URL encoder and decoder. The core is entirely written in JavaScript.
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width">
<title>URL Decoder/Encoder</title>
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>
@santosh
santosh / getFullName.py
Created February 22, 2013 19:18
Get current user's (the user who runs the script) full name (UNIX), as in finger command.
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import os
import pwd
print(pwd.getpwuid(os.getuid())[4])