Skip to content

Instantly share code, notes, and snippets.

View dskanth's full-sized avatar

Shasi kanth dskanth

View GitHub Profile
@dskanth
dskanth / app.js
Created May 8, 2012 10:56
Server file for Private chat using node.js and socket.io
var app = require('express').createServer()
var io = require('socket.io').listen(app);
var fs = require('fs');
app.listen(8008);
// routing
app.get('/', function (req, res) {
res.sendfile(__dirname + '/chat.html');
});
@dskanth
dskanth / chat.html
Created May 8, 2012 11:00
Client file for Private chat using node.js and socket.io
<script src="/socket.io/socket.io.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
var my_username = '';
function send_individual_msg(id)
{
//alert(id);
//alert(my_username);
socket.emit('check_user', my_username, id);
//socket.emit('msg_user', id, my_username, prompt("Type your message:"));
@dskanth
dskanth / verify-google-recaptcha-with-php
Last active July 26, 2017 11:50 — forked from jonathanstark/verify-google-recaptcha-with-php
Verify Google reCAPTCHA with PHP
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
@dskanth
dskanth / temp.txt
Last active November 16, 2017 09:40
Temp content storage
https://www.google.co.in
@dskanth
dskanth / Switch.vue
Created August 17, 2023 11:54 — forked from thomaslombart/Switch.vue
An example of a toggle switch with Vue 3
<template>
<label class="container">
<input
v-bind="$attrs"
class="input"
type="checkbox"
:checked="checked"
@change="$emit('update:checked', $event.target.checked)"
/>
<span class="switch"></span>