Skip to content

Instantly share code, notes, and snippets.

View envyen's full-sized avatar

Naveen Karuthedath envyen

View GitHub Profile
@envyen
envyen / CMakeLists.txt
Created July 6, 2021 15:17 — forked from UnaNancyOwen/CMakeLists.txt
First Samplle for OpenCV with ImGui
cmake_minimum_required( VERSION 3.6 )
set( CMAKE_CXX_STANDARD 11 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF )
find_package( Git )
execute_process(
COMMAND ${GIT_EXECUTABLE} clone "https://github.com/ocornut/imgui.git" -b v1.72b
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
@envyen
envyen / LICENSE
Created July 6, 2021 15:14 — forked from insaneyilin/show_opencv_image_in_opengl.cpp
Show opencv cv::Mat image in an OpenGL window(use GLFW)
# Released under MIT License
Copyright (c) 2017 insaneyilin.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WI
@envyen
envyen / Encoder.hpp
Created March 1, 2021 04:08 — forked from sdumetz/Encoder.hpp
barebone C++ MPEG4/h264 video encoder using libavformat and libavcodec. Options choice is explained in https://sdumetz.github.io/2017/05/19/libav-encoding-for-ios.html
#include <stdio.h>
#include <iostream>
extern "C"{
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/imgutils.h> //for av_image_alloc only
#include <libavutil/opt.h>
// ImGui - standalone example application for Glfw + OpenGL 3, using programmable pipeline
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
#include <imgui.h>
#include "imgui_impl_glfw_gl3.h"
#include <stdio.h>
#include <GL/gl3w.h>
#include <GLFW/glfw3.h>
static void error_callback(int error, const char* description)
@envyen
envyen / background_gradients.c
Created December 15, 2020 04:13 — forked from mhalber/background_gradients.c
OpenGL Gradient Background
// background_gradients.c
// Author: Maciej Halber
// Compiled on macOS 10.12.4 with :
// clang --std=c11 -lglfw3 -framework OpenGL background_gradients.c -o background_gradients
#include <stdio.h>
#include <stdlib.h>
#if defined(__APPLE__)
#include <OpenGL/gl3.h>
@envyen
envyen / index.html
Last active August 10, 2017 10:09 — forked from mandulaj/index.html
Webssh
<!doctype html>
<html>
<head>
<title>SSH Client</title>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.5/socket.io.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<style>
body {
margin: 0;
padding: 0;
# /usr/lib/systemd/system/asus-kbd-backlight.service
[Unit]
Description=Asus Keyboard Backlight
Wants=systemd-backlight@leds:asus::kbd_backlight.service
After=systemd-backlight@leds:asus::kbd_backlight.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/chown root:backlight /sys/class/leds/asus::kbd_backlight/brightness
@envyen
envyen / gist:294834d403a7a2685c333e41ff598d00
Created July 2, 2017 03:57 — forked from robmint/gist:4753401
Basic linux framebuffer graphics setup
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <stdint.h>
#include <stdbool.h>
#include <linux/input.h>
@envyen
envyen / rtsp-live.c
Created February 22, 2017 04:31 — forked from angri/rtsp-live.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <glib.h>
#define GST_USE_UNSTABLE_API
#include <gst/gst.h>
#include <gst/rtsp-server/rtsp-server.h>
@envyen
envyen / ffmpeg.sh
Created February 15, 2017 04:22 — forked from galori/ffmpeg.sh
ffmpeg
#!/bin/sh
echo 'usage: ./ffmpeg_to_gif.sh ~/Downloads/test.mov ~/Downloads/test.gif'
palette="/tmp/palette.png"
filters="fps=15,scale=1000:-1:flags=lanczos"
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2