Skip to content

Instantly share code, notes, and snippets.

View AmruthPillai's full-sized avatar
🎯
Channelling my Inner Chi

Amruth Pillai AmruthPillai

🎯
Channelling my Inner Chi
View GitHub Profile
@AmruthPillai
AmruthPillai / colors.xml
Last active October 16, 2016 04:38
Google Material Design Color Palette for Android XML
<?xml version="1.0" encoding="utf-8"?>
<!--
Google Material Design Color Palette for Android XML
http://www.google.com/design/spec/style/color.html#color-ui-color-palette
-->
<resources>
<color name="red_50">#FFEBEE</color>
<color name="red_100">#FFCDD2</color>
@AmruthPillai
AmruthPillai / OpenGL-House.cpp
Created February 16, 2017 07:31
My first house, on OpenGL. One small step for man.
#include <GL/GLUT.h>
void init(float r, float g, float b) {
glClearColor(r, g, b, 0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0, 0.0, 0.0, 0.0);
}
void display() {
glClear(GL_COLOR_BUFFER_BIT);
@AmruthPillai
AmruthPillai / install-lamp-1604.sh
Created July 14, 2017 09:51
Installing Apache 2.4, PHP 7.1, MySQL 5.7.18 & phpMyAdmin 4.5.4 on Ubuntu 16.04
#!/bin/bash
# Update Indices
sudo apt-get update
# Apache 2.4
sudo apt-get -y install apache2
# PHP 7.1
sudo apt-get -y remove php*
@AmruthPillai
AmruthPillai / TriangularNumbers.java
Created July 22, 2017 17:57
Any of the series of numbers (1, 3, 6, 10, 15, etc.) obtained by continued summation of the natural numbers 1, 2, 3, 4, 5, etc. Read more here: https://www.mathsisfun.com/algebra/triangular-numbers.html
public class TriangularNumbers {
public static void main(String[] args) {
int n = 0;
for (int i = 1; i <= 10; i++)
System.out.println(n += i);
}
@AmruthPillai
AmruthPillai / rsa.c
Created August 8, 2017 05:14
RSA Algorithm in C
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int checkPrime(int n) {
int i;
int m = n / 2;
for (i = 2; i <= m; i++) {
if (n % i == 0) {
@AmruthPillai
AmruthPillai / Program52.py
Created August 21, 2017 14:30
Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number.
"""
Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number.
"""
largest = None
smallest = None
while True:
try:
num = raw_input("Enter a number: ")
@AmruthPillai
AmruthPillai / index.html
Created May 12, 2018 15:47
Learn Bootstrap 4 in under 5 minutes
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Fake Co.</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB"
crossorigin="anonymous">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CSS Grid Playground</title>
@AmruthPillai
AmruthPillai / encrypt.dart
Created March 8, 2020 12:01
Be Thrifty Today - Encryption
import 'package:encrypt/encrypt.dart';
const CRYPT_KEY = '';
String encrypt(String text) {
if (text == null || text.isEmpty) return null;
final key = Key.fromUtf8(CRYPT_KEY);
final encrypter = Encrypter(AES(key, mode: AESMode.ecb));
return encrypter.encrypt(text).base64;
}
@AmruthPillai
AmruthPillai / GitHubContributors.vue
Last active March 29, 2020 12:12
A Vue Component that Displays a Grid of Users who have Contributed to a GitHub Repo, used with VuePress for Documentation
<template>
<div class="contributors">
<div v-for="i in items">
<a :href="i.html_url" target="_blank" rel="noopener noreferrer">
<img :src="i.avatar_url" />
</a>
</div>
</div>
</template>