Skip to content

Instantly share code, notes, and snippets.

View tk120404's full-sized avatar
🎯
Focusing

Arjunkumar tk120404

🎯
Focusing
View GitHub Profile
<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 August 15, 2014 05:40
Mount usb in raspberrpi
sudo blkit
sudo mount -t vfat -o defaults,user,exec,uid=1000,gid=100,umask=000,rw /dev/sda1 /mnt/usb

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@tk120404
tk120404 / image.js
Created May 7, 2015 10:57
Print image in the javascript console
console.log("%c ","font-size:50px;background-image:url(http://goo.gl/uMbhMT); background-size:contain; background-repeat:no-repeat;")
@tk120404
tk120404 / introrx.md
Created December 1, 2015 06:47 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@tk120404
tk120404 / MultiSelect
Created April 1, 2013 06:26
Group Select using select and optgroup
<!DOCTYPE html>
<html>
<head>
<title>Multi Select</title>
<style>
#select-from, #select-to {
width: 200px;
height: 200px;
}
</style>
@tk120404
tk120404 / BCryptSearchModeSearchDatabaseAuthenticationHandler.java
Last active December 16, 2015 03:39
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
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 April 15, 2013 17:59
What is the student_id of the lowest exam score above 65? Mongodb
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 December 20, 2015 14:28
"v" in javascript
Got "v" from here
http://discogscounter.getfreehosting.co.uk/js-noalnum.php
(+(+[])+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+!+[]+[+[]]]
http://stackoverflow.com/questions/2343557/in-javascript
@tk120404
tk120404 / property.js
Last active December 29, 2015 07:59
Same property names in javascript
var a = {};
console.log(a);
Object {}
a.name = 'Object';
Object.prototype.name = 'Object';