Skip to content

Instantly share code, notes, and snippets.

View arvindr21's full-sized avatar
💭
Meh

Arvind Ravulavaru arvindr21

💭
Meh
View GitHub Profile
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
@arvindr21
arvindr21 / resize.js
Created November 24, 2014 10:36
Resize a popup window using javascript
var i=0;
function resize() {
i=0;
// if (navigator.appName == 'Netscape') i=20;
if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1 && window.navigator.userAgent.indexOf('SV1') != -1) {
i=30; //This browser is Internet Explorer 6.x on Windows XP SP2
} else if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1) {
i=0; //This browser is Internet Explorer 6.x
} else if (window.navigator.userAgent.indexOf('Firefox') != -1 && window.navigator.userAgent.indexOf("Windows") != -1) {
i=25; //This browser is Firefox on Windows
angular.module('test')
.controller('HomeCtrl', function ($scope, $http, Socket) {
var vm = this;
vm.items = [];
vm.lastMsg = '';
$http.get('/api/items').success(function (res) {
vm.items = res;
@arvindr21
arvindr21 / app.js
Last active August 29, 2015 14:22
Todo App
angular.module('TodoApp', [])
.controller('AppCtrl', function($scope, TodoFactory) {
$scope.todos = TodoFactory.get();
$scope.addTodo = function($event) {
var keyCode = $event.which || $event.keyCode;
if (keyCode === 13) {
@arvindr21
arvindr21 / console message.txt
Created August 6, 2015 16:06
console message
var faviconUrl="http://theiotsuitcase.com/assets/ico/apple-icon-60x60.png",css=("background-image: url('"+faviconUrl+"');"+"background-repeat: no-repeat;"+"display: block;"+"background-size: 13px 13px;"+"padding-left: 13px;"+"margin-left: 5px;"),text="Hello 'Under-hood Looker'! Did you loose something or just looking for a way to join us (Contact us: http://thejackalofjavascript.com/portfolio/#/contact)? ";
if(navigator.userAgent.match(/chrome/i)){
console.log(text+'%c',css);
}else{
console.log('%c '+text,css);
}
@arvindr21
arvindr21 / html5-video-streamer.js
Created December 9, 2015 05:55 — forked from paolorossi/html5-video-streamer.js
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@arvindr21
arvindr21 / InstallationStack.md
Created February 15, 2016 04:36 — forked from pjnovas/InstallationStack.md
Complete Install on Ubuntu Server of Nodejs + MongoDB + NGINX

##Ubuntu Server

NodeJS

sudo apt-get install g++ curl libssl-dev apache2-utils git-core make
cd /usr/local/src
wget http://nodejs.org/dist/v0.10.28/node-v0.10.28.tar.gz
tar -xvzf node-v0.10.28.tar.gz
cd node-v0.10.28
angular.module('TodoApp', [])
.controller('AppCtrl', function($scope, TodoDataFactory) {
$scope.todos = TodoDataFactory.get();
var UUID = 0;
function addTodo($event) {
var keyCode = $event.keyCode || $event.which;
if (keyCode === 13 && $scope.todoText) {
var todo = {
<!DOCTYPE html>
<html ng-app="TodoApp">
<head>
<script src="angular.js"></script>
<script src="app.js"></script>
<style>
ul {
list-style: none;
}