Skip to content

Instantly share code, notes, and snippets.

View arunkarnann's full-sized avatar
🎯
Focusing

Arun Karnan arunkarnann

🎯
Focusing
View GitHub Profile
import * as ACTION_TYPES from '../actions/action_types'
const initialState = {
stateprop1 : false
}
const Reducer1 = (state = initialState, action) => {
switch(action.type){
case ACTION_TYPES.SUCCESS:
console.log("In Reducer 1")
@arunkarnann
arunkarnann / action.js
Created August 26, 2019 14:33
Action JS for Udemy Course
import * as ACTION_TYPES from "./action_types"
export const SUCCESS = {
type: ACTION_TYPES.SUCCESS
}
export const FAILURE = {
type: ACTION_TYPES.FAILURE
}
@arunkarnann
arunkarnann / mergealltxt.py
Created July 25, 2019 05:18
Merges all txt file the current folder and create a new file with all contents
import shutil
import glob
outfilename = "all.txt"
with open(outfilename, 'wb') as outfile:
for filename in glob.glob('*.txt'):
if filename == outfilename:
# don't want to copy the output into the output
continue
with open(filename, 'rb') as readfile:
shutil.copyfileobj(readfile, outfile)
@arunkarnann
arunkarnann / selenium.py
Created January 28, 2019 05:04
A selenium fuction demonstrations.
#Install selenium with pip install selenium
#and make sure you place Chromedriver on the code path and latest Chrome Installed
import selenium
#used for sending keys
from selenium.webdriver.common.keys import Keys
#Used for Waiting for a xapth to be available
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
@arunkarnann
arunkarnann / mergecsv.py
Created January 28, 2019 04:32
A Gist in python using pandas that merge all csv files in a given directory , Also removes duplicate rows and filter rows based on Content matching.
import pandas as pd
import glob,os
#folder in which files are there
files="D:\\Projects\\CSVMERGE\\muse\\"
#Combining all CSVs
combined_csv = pd.concat( [ pd.read_csv(f,encoding = "ISO-8859-1") for f in glob.glob(os.path.join(files,'*.csv')) ] ,ignore_index=True)
#Removing Duplicates
combined_csv = combined_csv[combined_csv['Name'].duplicated() == False]
@arunkarnann
arunkarnann / soundmanager.cs
Last active March 27, 2018 18:34
Simple Sound Manger Thats Plays any sound and takes care of overlaps and Volume. UNITY3D , Unity3D c#
using UnityEngine;
using System.Collections.Generic;
/// <summary>
/// Sound Manager Script for all types of Games :: @arunkarnan
/// </summary>
[System.Serializable]
public class SoundData
{
public SoundManager.Sounds soundEnum;
@arunkarnann
arunkarnann / jd.py
Created February 8, 2018 10:08
Jd Scrapper
import requests
from lxml import html
from tkinter import *
#import tkinter as ttk
import re
import datetime
import os
from firebase import firebase
import hashlib
#import App as App
@arunkarnann
arunkarnann / jd.py
Created February 8, 2018 09:38
jd scrapper
import requests
from lxml import html
from tkinter import *
import tkinter as ttk
import re
import datetime
import os
from firebase import firebase
import hashlib
#import App as App
@arunkarnann
arunkarnann / CameraZoom.cs
Created January 18, 2018 12:34
Unity 3d Camera Script calculate postion to move the camera to show two Game objects inside the camera. || Show two game objects in camera .
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraZoom : MonoBehaviour {
public Transform player1;
public Transform player2;
private const float DISTANCE_MARGIN = 1.0f;
@arunkarnann
arunkarnann / TouchDetection.cs
Created October 1, 2017 16:19
Double Tap detection Unity3D Games..
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TouchDetection : MonoBehaviour {
bool singleTouch;
float doubleClickSpeed = 1.5f;
float timeElapsed = 0.0f;
void Update(){