Skip to content

Instantly share code, notes, and snippets.

View athulmurali's full-sized avatar
🎯

Athul Muralidharan athulmurali

🎯
View GitHub Profile
@athulmurali
athulmurali / merge_subtitles_with_video.py
Created February 27, 2017 10:40 — forked from altermarkive/merge_subtitles_with_video.py
Python script for merging video files (AVI, MP4, MKV) with subtitles (SRT) using ffmpeg (on Windows it will also handle font configuration)
# Have you ever saw this error while trying to merge/embed subtitles
# into a video file on Windows?
#
# Fontconfig error: Cannot load default config file
# [Parsed_subtitles_0 @ 0000000002bf1ee0] No usable fontconfig configuration # file
# found, using fallback.
# Fontconfig error: Cannot load default config file
#
# This scripts merges subtitles (if present) and transcodes video files
# to H.264 mp4 video files with similar quality level.
@athulmurali
athulmurali / signal.c
Created February 8, 2018 21:07 — forked from aspyct/signal.c
Unix signal handling example in C, SIGINT, SIGALRM, SIGHUP...
/**
* More info?
* a.dotreppe@aspyct.org
* http://aspyct.org
* @aspyct (twitter)
*
* Hope it helps :)
*/
#include <stdio.h>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BlackSheep Plagiarism: Welcome</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<!-- Bootstrap CSS -->
@athulmurali
athulmurali / server.js
Created July 31, 2018 10:07
express-code-angular
//Install express server
const express = require('express');
const path = require('path');
const app = express();
// Serve only the static files form the dist directory
app.use(express.static(`${__dirname}/front-end/dist/`));
app.get('/*', function(req,res) {
@athulmurali
athulmurali / Connection.java
Last active October 21, 2018 21:01 — forked from jasoet/gist:3843797
Database Connection Singleton
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.secondstack.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
#!/usr/bin/env bash
#sh
export DB_URL='mongodb://rfid:rfid1234@ds223756.mlab.com:23756/crappy-logger'
node server.js
@athulmurali
athulmurali / Closure.js
Last active May 26, 2019 16:41
Singleton Pattern
import coursesData from './courses'
function CourseService() {
let courses = coursesData;
return {
addCourse: (newCourse) => {
courses.push(newCourse);
},
deleteCourse: (id) => {
courses = courses.filter(course => course.id !== id)
},
@athulmurali
athulmurali / WidgetListEditor.js
Last active June 1, 2019 03:39
Sample redux code
import React from 'react';
import WidgetListContainer from './WidgetListContainer'
import {applyMiddleware, createStore} from 'redux'
import logger from 'redux-logger'
import {Provider} from 'react-redux'
import {widgetReducer} from "../reducers/widgetReducer"
let store = createStore(widgetReducer);
@athulmurali
athulmurali / selection.js
Last active June 3, 2019 15:37
Selection fix
//Note: some may have selectedWidget, some may not , ignore it if it is not yours.
// while selecting a module, set topic and selectedWidget to null so that you don't retain the existing selection
// while selecting a lesson, set widget and selectedWidget to null
// This is just a sample code
this.state={
// ...
selectedModule: course.modules[0],
selectedLesson: course.modules[0].lessons[0],
1. React dev tools
2. anchor tag issues