Skip to content

Instantly share code, notes, and snippets.

View harishkotra's full-sized avatar
🏠
Working from home

Harish Kotra harishkotra

🏠
Working from home
View GitHub Profile
@harishkotra
harishkotra / countries.json
Created April 15, 2019 11:37
A list of all countries in JSON. Data last updated on March 1, 2019 and as per https://www.britannica.com/topic/list-of-countries-1993160
[
{ name: "Afghanistan" },
{ name: "Albania" },
{ name: "Algeria" },
{ name: "Andorra" },
{ name: "Angola" },
{ name: "Antigua and Barbuda" },
{ name: "Argentina" },
{ name: "Armenia" },
{ name: "Australia" },
@harishkotra
harishkotra / RemoveDuplicates.java
Created July 10, 2018 12:43
Design an algorithm and write code to remove the duplicate characters in a string
import java.io.*;
import java.util.*;
public class RemoveDuplicates{
public static void main(String []args){
String s = "aabnsbsbsssbbsbsbs";
char[] characters = s.toCharArray();
Set<Character> newSet = new LinkedHashSet<Character>();
@harishkotra
harishkotra / ReverseString.java
Created July 10, 2018 11:21
Java program to reverse a string without worrying about a null.
public class ReverseString{
public static void main(String []args){
String myString = "this is the test";
System.out.println(reverse(myString));
}
public static String reverse(String str){
System.out.println("Original Length " + str.length());
char[] data = str.toCharArray();
@harishkotra
harishkotra / ReverseString.java
Created July 10, 2018 11:21
Java program to reverse a string without worrying about a null.
public class ReverseString{
public static void main(String []args){
String myString = "this is the test";
System.out.println(reverse(myString));
}
public static String reverse(String str){
System.out.println("Original Length " + str.length());
char[] data = str.toCharArray();
@harishkotra
harishkotra / npm-updater.txt
Created May 6, 2018 07:36
Steps to update npm on Windows
**This is the new best way to upgrade npm on Windows.**
**Run PowerShell as Administrator**
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install -g npm-windows-upgrade
npm-windows-upgrade
@harishkotra
harishkotra / decryptor.php
Last active April 16, 2018 13:10
Decrypt CodeIgniter Password
<?php
$encrypted_password = 'ENCRYPTED_PASSWORD_HERE';
$key = 'KEY_FROM_CONFIG_FILE_HERE';
$decrypted_string = $this->encrypt->decode($encrypted_password, $key);
echo $decrypted_string;
?>
@harishkotra
harishkotra / .htaccess
Created October 9, 2017 10:47
.htaccess hacks for speeding up WordPress
#Enable Keep-Alive
#Keep alive is a method to allow the same tcp connection for HTTP conversation instead of opening a new one with each new request.
#More simply put, it is a communication between the web server and the web browser that says "you can grab more than just one file at a time".
#Keep alive is also known as a persistant connection
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>
#Enable gzip
@harishkotra
harishkotra / stock-data.txt
Created April 29, 2017 09:20
Pull stock market data
Links to help get stock market data:
http://finance.google.com/finance/info?client=ig&q=NASDAQ%3AGOOG
Using Google API:http://digitalpbk.com/stock/google-finance-get-stock-quote-realtime
External Website: https://www.quandl.com/
@harishkotra
harishkotra / v-if-else.html
Created April 11, 2017 02:52
Vue.js - Using v-if and v-else to display a different message to the user based on what is typed in the input field.
<html>
<head>
<!-- just any other regular html tag -->
<title>Vue Demo App with v-if & v-else directives</title>
<!-- Fetch vue.js from the following library -->
<!-- Other alternatives are to download the original library from https://vuejs.org/ -->
<script src="https://unpkg.com/vue"></script>
<style>
#app {
font-family: 'Montserrat', Helvetica, Arial, sans-serif;
@harishkotra
harishkotra / v-show.html
Created April 11, 2017 02:44
Vue.js - v-show directive example to hide an element if no input is received in a text field.
<html>
<head>
<!-- just any other regular html tag -->
<title>Vue Demo App with v-show directive</title>
<!-- Fetch vue.js from the following library -->
<!-- Other alternatives are to download the original library from https://vuejs.org/ -->
<script src="https://unpkg.com/vue"></script>
<style>
#app {
font-family: 'Montserrat', Helvetica, Arial, sans-serif;