Skip to content

Instantly share code, notes, and snippets.

View redknitin's full-sized avatar
💭
Picking a coding challenge every week, while actively on a job-search.

Nitin redknitin

💭
Picking a coding challenge every week, while actively on a job-search.
View GitHub Profile
@redknitin
redknitin / Dockerfile
Created October 27, 2018 09:56
Dockerfile for cx_Oracle
FROM ubuntu:18.04
COPY ./sources_list /etc/apt/sources.list
#The above fixes the 404 by providing an alternate repo specific to 18.04
#FROM ubuntu:latest
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt install -y wget build-essential libaio-dev python3 python3-setuptools python3-pip python3-dev zip unzip net-tools iputils-ping
#CMD ping -c 4 www.google.com
#RUN easy-install pip
@redknitin
redknitin / app.py
Created October 19, 2018 08:43
Jinja template in Flask
from flask import Flask
from jinja2 import Environment, FileSystemLoader
j2_env = Environment(loader=FileSystemLoader('templates'), trim_blocks=True)
app = Flask(__name__)
@app.route('/')
def home():
return j2_env.get_template('index.j2').render(name='Nitin')
@redknitin
redknitin / App.js
Created October 19, 2018 08:13
Redux React Starter
import React, { Component } from 'react';
import './App.css';
import { BrowserRouter, Route, Link } from 'react-router-dom';
import Home from './components/Home'
class App extends Component {
render() {
return (
<BrowserRouter>
<Route exact path="/" component={Home} />
@redknitin
redknitin / pord01.html
Last active August 23, 2018 12:54
Javascript - Construct a table from an object array
<!doctype html><html>
<head>
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<script>
var rows = []
function saveItem() {
@redknitin
redknitin / web01.html
Created August 21, 2018 14:16
CSS Animation - Translation and Opacity
<!doctype html><html>
<head>
<title></title>
<style>
body {
background-color: black;
}
@keyframes wiggum {
0% { transform: translateX(0px); }
@redknitin
redknitin / web02.html
Created August 21, 2018 14:15
CSS Animation - Simulate HTML blink tag
<!doctype html><html>
<head>
<title></title>
<style>
@keyframes glowshift { from { text-shadow: 0px 0px 25px #00f; } to { text-shadow: 0px 0px 25px #0f0; } }
@keyframes blinker { from {opacity: 1;} to {opacity: 0.05}; }
/* @keyframes buzzingPointObj {
0% { transform: translate3d(0,0,0,0); }
10% { transform: translate3d(800px, 160px, 0); }
20% { transform: translate3d(800px, 00px, 0); }
@redknitin
redknitin / Dockerfile
Created August 21, 2018 14:14
Docker example
FROM python:2.7-slim
WORKDIR /app
ADD . /app
RUN pip install --trusted-host pypi.python.org -r requirements.txt
EXPOSE 80
ENV NAME World
CMD [ "python", "app.py" ]
@redknitin
redknitin / App.js
Created August 21, 2018 14:11
Using a Redux Store
import React, { Component } from 'react';
import './App.css';
import { createStore } from 'redux';
const CHANGE_CARD_VISIBILITY = 'CHANGE_CARD_VISIBILITY';
function rootReducer(state = [], action) {
switch(action.type) {
case CHANGE_CARD_VISIBILITY:
@redknitin
redknitin / tableofdates.sql
Created April 2, 2018 09:27
PL/SQL 'Table-valued function' to return list of dates
--PLSQL 'Table-valued function'
create type my_dt_type is object(dt date);
/
create type my_dt_tab_type is table of my_dt_type;
/
create or replace function get_all_dates(p_start IN DATE, p_end IN DATE)
return my_dt_tab_type pipelined is
@redknitin
redknitin / cascadingddl.html
Created November 1, 2017 12:39
Cascading dropdowns in HTML-JS with static data
<!--
Name: Cascading Dropdowns for Static Data
Description: Provide a dictionary object using JSON and the pair of dropdowns to link together
Author: Nitin
-->
<!doctype html><html><head>
<script>
function ddlpopulate(ddl, arr) {
ddl.options.length = 0;