Skip to content

Instantly share code, notes, and snippets.

Looking for new challenges


Looking for new challenges
View GitHub Profile
kuldipem / android-os-and-browser-detect
Created Aug 20, 2014
Javascript snippet to detect android mobile,browser (Stock browser) and get OS version
View android-os-and-browser-detect
var android = {
uAString: function() {
return navigator.userAgent;
// Android Mobile
isAndroidMobile: function() {
return android.uAString().indexOf('Android') > -1 && android.uAString().indexOf('Mozilla/5.0') > -1 && android.uAString().indexOf('AppleWebKit') > -1;
// Android Browser (not Chrome)
regExAppleWebKit: function() {
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl | sh
kuldipem / install.php
Last active Aug 29, 2015
To install tables using php from .sql file.
View install.php
if(empty($_POST["inputHost"]) ||
empty($_POST["inputDb"]) ||
empty($_POST["inputUsr"]) ||
empty($_POST["inputPwd"]) ||
die("<h1>All fields are required.</h1>");
// Name of the file
$filename = 'shoping.sql';
kuldipem / util-functions
Last active Aug 29, 2015
get unique values within range
View util-functions
function getUniqeValueWithinRang($count=10,$min=0,$max=10){
while(in_array($ran=rand($min,$max), $uniqValuesInRange));
array_push($uniqValuesInRange, $ran);
return $uniqValuesInRange;

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here:

View DropEntityTableCommand
namespace Kem\CoreBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
kuldipem / iloveyou.c
Created Jul 21, 2015
Want to impress your girlfriend/boyfriend by your coding skill ?
View iloveyou.c
* File: main.c
* Created on 17 July, 2015, 10:17 AM
#include <stdio.h>
#include <stdlib.h>
kuldipem / SassMeister-input.scss
Created Nov 27, 2015
Generated by
View SassMeister-input.scss
// ----
// libsass (v3.2.5)
// ----
$colors: #800080, #ff0000, #dc143c, #ff4500, #ff0000,#ffa500,#ff4500,
$max: length($colors);
$dash: 10;
kuldipem / jquery.alterclass.js
Created Apr 5, 2016 — forked from peteboere/jquery.alterclass.js
jQuery alterClass plugin: Remove element classes with wildcard matching. Optionally add classes.
View jquery.alterclass.js
* jQuery alterClass plugin
* Remove element classes with wildcard matching. Optionally add classes:
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' )
* Copyright (c) 2011 Pete Boere (
* Free under terms of the MIT license: