Skip to content

Instantly share code, notes, and snippets.

View arangates's full-sized avatar
🔬
Gedankenerfahrung

Aranganathan Rathinavelu arangates

🔬
Gedankenerfahrung
View GitHub Profile
@arangates
arangates / httpparams.service.ts
Created February 26, 2018 11:03 — forked from anonymous/httpparams.service.ts
Abgular 5 HTTPS params conversion
function toHttpParams(params) {
return Object.getOwnPropertyNames(params)
.reduce((p, key) => p.set(key, params[key]), new HttpParams());
}
// Example:
toHttpParams({firstName: 'John', lastName: 'Doe'});
@arangates
arangates / meta-tags.md
Created March 29, 2018 14:17 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@arangates
arangates / seo.service.ts
Created March 29, 2018 14:23 — forked from nhathiwala/seo.service.ts
SEO Service for Angular 4+
import { Injectable } from '@angular/core';
import { Meta, Title } from '@angular/platform-browser';
export interface TypingSEO {
title?: string;
titleSuffix?: string;
description?: string;
image?: string;
keywords?: string;
url?: string;
@arangates
arangates / gita.json
Created August 20, 2018 10:18
Bagawad gita json
[
{
"id": 0,
"title": 1.1,
"devanagari": "धृतराष्ट्र उवाच ।\nधर्मक्षेत्रे कुरुक्षेत्रे समवेता युयुत्सवः\nमामकाः पाण्डवाश्चैव किमकुर्वत सञ्जय ॥ १.१ ॥",
"verse_text": "dhṛtarāṣṭra uvāca\ndharma-kṣetre kuru-kṣetre\nsamavetā yuyutsavaḥ\nmāmakāḥ pāṇḍavāś caiva\nkim akurvata sañjaya",
"verse_text_no_samdhis": "dhṛtarāṣṭraḥ uvāca dharma kṣetre kuru kṣetre samavetāḥ yuyutsavaḥ māmakāḥ pāṇḍavāḥ ca eva kim akurvata sañjaya"
},
{
"id": 1,
{
"1": "Chapter 1",
"2": "Chapter 2",
"3": "Chapter 3",
"4": "Chapter 4",
"5": "Chapter 5",
"6": "Chapter 6",
"7": "Chapter 7",
"8": "Chapter 8",
"9": "Chapter 9",
@arangates
arangates / AesJava.java
Created December 19, 2018 03:34
AES encryption + decryption
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import javax.crypto.spec.IvParameterSpec;
@arangates
arangates / linearregression.py
Created June 5, 2017 04:21
A linear regression line has an equation of the form Y = a + bX, where X is the explanatory variable and Y is the dependent variable. The slope of the line is b, and a is the intercept (the value of y when x = 0).
from __future__ import division
# Define the data
data = set()
count = int(raw_input("Enter the number of data points: "))
for i in range(count):
x=float(raw_input("X"+str(i+1)+": "))
y=float(raw_input("Y"+str(i+1)+": "))
data.add((x,y))
@arangates
arangates / Music-classification-into-genres.py
Created June 23, 2019 17:42 — forked from sdoshi579/Music-classification-into-genres.py
Model generated to classify extracted features from music clips into different genres
import librosa
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import os
import csv
# Preprocessing
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, StandardScaler
# <------------------------NORMAL FUNCTION -------------------------------->
# # Build and return a list
# def getKeys(data):
# return list(data.keys())
# obj = { 'bar': "hello", 'baz': "world" }
# keys_list = getKeys(obj)
# <------------------------BEHIND THE SCENE ------------------------------->
@arangates
arangates / Linux.txt
Created December 10, 2019 09:27
list of useful commands
# change default terminal
sudo update-alternatives --config x-terminal-emulator
# list shells
cat /etc/shells
# change default shell
chsh -s $(which shellname)