Skip to content

Instantly share code, notes, and snippets.

View santosh's full-sized avatar
:octocat:

Santosh Kumar santosh

:octocat:
View GitHub Profile

English to rövarspråket converter

Call it like:

$ ./e2r.py "the english string"

Or import it into script:

from e2r import e2r
@santosh
santosh / printflush.py
Created March 25, 2013 09:18
This script demonstrate the `flush` argument of print() function.
#!/usr/bin/env python
#-*- coding: utf-8 -*-
from __future__ import print_function
from time import sleep
string = "The words in this sentence should appear letter by letter."
print("Please wait if you don't see another sentence appearing below.", end="\n\n")
@santosh
santosh / raw_input.py
Created March 13, 2013 11:41
Erase conflict between input() and raw_input().
try:
input = raw_input
except NameError:
pass
@santosh
santosh / python_keywords.py
Created February 26, 2013 07:22
This script lists the python keywords. Its portable so running as $ python python_keywords.py will list for Python 2 and $ python3 python_keywords.py will return for Python 3. Basically it will list the keywords of the current interpreter.
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
import keyword
'''
File: python_keywords.py
Author : Santosh Kumar <https://twitter.com/sntshk>
Date created: Fri 22 Feb 2013 07:00:09 PM IST
@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])
@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 / 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 / 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 / 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 / ChangeLink.html
Last active December 10, 2015 12:18
JavaScript: An example of changing link on the time when user clicks on it..