Skip to content

Instantly share code, notes, and snippets.

View shakirullahi's full-sized avatar
🔆
hakuna matata

Sakirullahi Puthenchirakkal shakirullahi

🔆
hakuna matata
View GitHub Profile
@shakirullahi
shakirullahi / delete duplicate.sql
Created July 28, 2016 04:23
delete duplicate rows except one with small id
DELETE n1 FROM names n1, names n2 WHERE n1.id > n2.id AND n1.name = n2.name
@shakirullahi
shakirullahi / Gearman-Windows.md
Created July 20, 2016 16:51 — forked from mnapoli/Gearman-Windows.md
Installing Gearman on windows

Gearman can be installed on Windows through cygwin.

Install Cygwin packages

Install cygwin packages (through setup.exe):

  • gcc
  • make
  • libuuid1-devel
  • libiconv
@shakirullahi
shakirullahi / verify.php
Created July 16, 2016 11:08
e-treasury : Verification defacement
<?php
$url = 'http://103.251.43.79/echallan/challan/models/frmgrnverificationdefacement.php';
$myvars = 'GRN=KL000001500201415E&USERID=abc';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
@shakirullahi
shakirullahi / exp.html
Last active July 15, 2016 19:05
Experience calculator : create a html file and put this code and run
<input type="text" id="from" placeholder="Starting date dd-mm-yyyy">
<input type="text" id="to" placeholder="Ending date dd-mm-yyyy">
<button onclick="calculate()">Calculate</button>
<script>
function calculate(){
var from = document.getElementById('from').value;
var to = document.getElementById('to').value;
from = from.split('-');
var from_day = parseInt(from[0]);
adb logcat | grep `adb shell ps | grep com.app.package | cut -c10-15`
#!/bin/bash
# change docRoot
docRoot=~/src/shakir/
for semester in */;
do
semester="${semester%?}"
cd "$docRoot/$semester/"
for branch in */;
@shakirullahi
shakirullahi / gist:8764646
Created February 2, 2014 08:16
jquery slector for input value
http://stackoverflow.com/questions/5060652/jquery-selector-for-input-value
@shakirullahi
shakirullahi / detectIE
Created February 1, 2014 02:13
Detecting IE in javascript
//Return IE version or if not IE return false
function isIE () {
var myNav = navigator.userAgent.toLowerCase();
return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
}
//Example:
if (isIE () == 8) {
@shakirullahi
shakirullahi / gist:8093974
Created December 23, 2013 09:22
Setting priority while pushing in firebase //credit:kato
var ref = new Firebase('https://<example>.firebaseio.com/rewards').push();
ref.setWithPriority({
name: 'apple',
otherKey: 'somevalue',
...
}, 'apple', function(err) {
if( error ) { console.error(err); }
else {
fetchValue();
// pros: does not fetch entire record set
// cons: grabs the last record which needs to be ignored
var first = true;
var ref = new Firebase(...);
ref.endAt().limit(1).on("child_added", function(snap) {
if( first ) {
first = false;
}
else {
console.log('new record', snap.val());