Skip to content

Instantly share code, notes, and snippets.

View chaitu87's full-sized avatar

Chaithanya Padi chaitu87

View GitHub Profile
@chaitu87
chaitu87 / session.aspx
Created July 13, 2016 14:41
Sample NET Code
<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="session.aspx.cs" Inherits="VedioCalling._Default" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<link href='https://fonts.googleapis.com/css?family=Josefin+Sans&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<%--<p>
<a href="javascript:void(0)" id="call-btn">Call</a>
<a href="javascript:void(0)" id="end-btn">End</a>
</p>--%>
<style>
li {
// Dealing with Internation ISD Codes
$('input[type="tel"]').intlTelInput({
initialCountry: "auto",
nationalMode: true,
geoIpLookup: function(callback) {
$.get('//ipinfo.io', function() {}, "jsonp").always(function(resp) {
var countryCode = (resp && resp.country) ? resp.country : "";
callback(countryCode);
});
}
@chaitu87
chaitu87 / setup-jira-bitbucket.sh
Last active June 9, 2017 14:44
Setting up jira & bitbucket servers on Digital Ocean
wget https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-software-7.2.6-x64.bin
# Install mysql 5.6
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ondrej/mysql-5.6
sudo apt-get update
sudo apt-get install mysql-server
create database jiradb character set utf8 collate utf8_bin;
grant select,insert,update,delete,create,drop,alter,index on jiradb.* to root@localhost identified by '**thepass**';
@chaitu87
chaitu87 / docrontest.sh
Last active December 12, 2016 19:46
test all jobs of cron
crontab -l | grep -v '^#' | cut -f 6- -d ' ' | while read CMD; do eval $CMD; done
@chaitu87
chaitu87 / precompilerrors.rb
Last active July 22, 2019 12:18
Finding precompile errors in rails, to be executed in 'rails console'
JS_PATH = "app/assets/javascripts/**/*.js";
Dir[JS_PATH].each do |file_name|
puts "\n#{file_name}"
begin
Uglifier.compile(File.read(file_name))
rescue => e
puts $!
puts $@
end
end
@chaitu87
chaitu87 / noko.sh
Created May 18, 2018 09:11
Nokogiri OSX setup
gem install nokogiri -v 1.6.8.1 -- --use-system-libraries=true --with-xml2-include="$(xcrun --show-sdk-path)"/usr/include/libxml2
@chaitu87
chaitu87 / default.md
Created July 9, 2018 08:08
Sample Grav Typography
title
Typography

! Details on the full capabilities of Spectre.css can be found in the Official Spectre Documentation

The Quark theme is the new default theme for Grav built with Spectre.css the lightweight, responsive and modern CSS framework. Spectre provides basic styles for typography, elements, and a responsive layout system that utilizes best practices and consistent language design.

Headings

#!/usr/bin/env sh
# checks to see if running
launchctl list | grep elasticsearch
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
launchctl remove homebrew.mxcl.elasticsearch
pkill -f elasticsearch
@chaitu87
chaitu87 / OSX_installers.txt
Created October 11, 2018 08:34
OSX Installers
macOS Sierra (10.12)
https://itunes.apple.com/us/app/macos-sierra/id1127487414?mt=12
macOS High Sierra (10.13)
https://itunes.apple.com/us/app/macos-high-sierra/id1246284741?mt=12
macOS Mojave (10.14)
https://itunes.apple.com/in/app/macos-mojave/id1398502828?mt=12
@chaitu87
chaitu87 / task.js
Last active November 14, 2019 11:48
Coding Exercise 14th November
// There are two arrays of Objects
var alist = [{a: 1, b: 2}, {a:3, c:20, d: 5}, {b: 20, a: 15}]
var blist = [{d: 12, c: 10}, {a:3, c:2}, {d: 10, b: 1}]
// PROBLEM #1
// --------------
// Create an array which is a union of alist & blist
// create a new array with objects which contain "a" attribute
// print this array