Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Arjunkumar tk120404

🎯
Focusing
View GitHub Profile
@tk120404
tk120404 / MultiSelect
Created Apr 1, 2013
Group Select using select and optgroup
View MultiSelect
<!DOCTYPE html>
<html>
<head>
<title>Multi Select</title>
<style>
#select-from, #select-to {
width: 200px;
height: 200px;
}
</style>
@tk120404
tk120404 / BCryptSearchModeSearchDatabaseAuthenticationHandler.java
Last active Dec 16, 2015
Enabling the mysql bcrypt for cas Update the cas.properties file of cas-server-webapp Update the pom file of the cas-server-support-jdbc Add BCryptSearchModeSearchDatabaseAuthenticationHandler.java to cas-server-support-jdbc Update the deployerConfigContext.xml of cas-server-webapp Update the pom file of the cas-server-webapp
View BCryptSearchModeSearchDatabaseAuthenticationHandler.java
package org.jasig.cas.adaptors.jdbc;
import org.jasig.cas.authentication.principal.UsernamePasswordCredentials;
import org.springframework.security.crypto.bcrypt.BCrypt;
import org.springframework.beans.factory.InitializingBean;
import org.jasig.cas.adaptors.jdbc.AbstractJdbcUsernamePasswordAuthenticationHandler;
public class BCryptSearchModeSearchDatabaseAuthenticationHandler extends
AbstractJdbcUsernamePasswordAuthenticationHandler implements InitializingBean {
@tk120404
tk120404 / Answer
Created Apr 15, 2013
What is the student_id of the lowest exam score above 65? Mongodb
View Answer
db.grades.aggregate({ $match : { score : { $gte : 65 }, type:'exam' }}, { $group:{_id:'$student_id',count:{$sum: 1}, score :{ $min:'$score'}}}, {'$sort':{'score':1}}, {'$limit':1});
Mongo Aggregration example http://docs.mongodb.org/manual/tutorial/aggregation-examples/
http://docs.mongodb.org/manual/reference/aggregation/match/
@tk120404
tk120404 / v.js
Last active Dec 20, 2015
"v" in javascript
View v.js
Got "v" from here
http://discogscounter.getfreehosting.co.uk/js-noalnum.php
(+(+[])+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+!+[]+[+[]]]
http://stackoverflow.com/questions/2343557/in-javascript
@tk120404
tk120404 / india.js
Last active Oct 4, 2016
Prints India Map as shown below in the india.txt node india.js
View india.js
var a,b=0,c=10,qwer ="TFy!QJu ROo TNn(ROo)SLq SLq ULo+UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^NBELPeHBFHT}TnALVlBLOFAkHFOuFETpHCStHAUFAgcEAelclcn^r^r\\tZvYxXyT|S~Pn SPm SOn TNn ULo0ULo#ULo-WHq!WFs XDt!";
while ((a = qwer.charCodeAt(b++)) != 0) {
while (a-- > 64) {
require('sys').print( ++c==90 ? String.fromCharCode(c = c/ 9):String.fromCharCode(33^b&1));
}
}
//Source : http://codepad.org/ngiITeZ4
@tk120404
tk120404 / property.js
Last active Dec 29, 2015
Same property names in javascript
View property.js
var a = {};
console.log(a);
Object {}
a.name = 'Object';
Object.prototype.name = 'Object';
@tk120404
tk120404 / gamedata.txt
Created Jan 28, 2014
Temple run 2(Android) cheat. No root required. Open any file Explorer (like ES File Explorer) and navigate to /sdcard/Android/Data/com.imangi.templerun2/files/. Replace this gamedata.txt content with this file content
View gamedata.txt
{"hash":"f3752abd2fbd9f1b706100325cd31542","data":{"version":7,"Players":[{"v":2,"pid":1,"bestScore":6397395,"bestScoreNoResurrection":3275168,"bestCoinScore":6478,"bestSpecialCurrencyScore":63,"bestDistanceScore":14459,"lifetimePlays":327,"lifetimeCoins":250027,"lifetimeSpecialCurrency":176,"lifetimeDistance":827577,"coinCount":12879,"specialCurrencyCount":26,"activePlayerCharacter":8,"gameCenterNeedsUpdate":true,"artifactsPurchased":[0,5,25,20,6,10,35,21,15,11,1,2,16,3,12,26,27,22,30,13,40,17,7,8,9,31,4,18,23,28],"artifactsDiscovered":[],"objectives":[2,1,0,5,4,44,6,7,9,3,8,49,11,48,16,12,10,18,14,17,23,24,21,50,22,15,13,52,20,19,28,26,25,27,43,31,32,30,46,29,45,35,33,34,53,42,36],"powersPurchased":[0,4,1,5],"randomSeed":-43418228,"numberResurectsUsed":0,"hashID":"17e20a8da3006e551f95d19a7270ed97","ldcc":0,"lwcc":0,"licc":0,"iappc":0,"iapms":0,"CollectablesFound":[{"CollectableId":18,"NumFound":7,"FoundState":"CollectFound_FoundAndViewed"},{"CollectableId":17,"NumFound":4,"FoundState":"CollectFound_FoundAnd
@tk120404
tk120404 / linkedlist.js
Last active Oct 4, 2016
LinkedList implemenation in Javascript
View linkedlist.js
var LinkedList = function()
{
this._head = this._tail = null;
this._transverse = null;
this._size = 0;
}
function QEntry(prev, obj, next)
{
if (typeof obj === 'undefined' || obj === null) {
View designer.html
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@tk120404
tk120404 / mountusb
Created Aug 15, 2014
Mount usb in raspberrpi
View mountusb
sudo blkit
sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000,rw /dev/sda1 /mnt/usb