Skip to content

Instantly share code, notes, and snippets.

View satishSKY's full-sized avatar

Satish Kumar Yadav satishSKY

  • Galaxyweblinks Inc
  • Indore
View GitHub Profile
@satishSKY
satishSKY / react-best-practices.md
Created August 17, 2020 12:35 — forked from cdiggins/react-best-practices.md
React Best Practices
@satishSKY
satishSKY / node_debian_init.sh
Created July 18, 2016 13:36 — forked from peterhost/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@satishSKY
satishSKY / angular-directive
Last active June 20, 2016 11:47
image 404 status checking
.directive('errSrc', function () { // image 404 status checking
return {
link: function (scope, element, attrs) {
element.bind('error', function () {
if (attrs.src != attrs.errSrc) {
attrs.$set('src', attrs.errSrc);
}
});
}
};
@satishSKY
satishSKY / livestream
Created May 19, 2016 11:01 — forked from deandob/livestream
Node.JS function to remux mp4/h.264 video from an IP camera to a HTML5 video tag using FFMPEG
// Live video stream management for HTML5 video. Uses FFMPEG to connect to H.264 camera stream,
// Camera stream is remuxed to a MP4 stream for HTML5 video compatibility and segments are recorded for later playback
var liveStream = function (req, resp) { // handle each client request by instantiating a new FFMPEG instance
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible).
var reqUrl = url.parse(req.url, true)
var cameraName = typeof reqUrl.pathname === "string" ? reqUrl.pathname.substring(1) : undefined;
if (cameraName) {
try {
cameraName = decodeURIComponent(cameraName);
@satishSKY
satishSKY / blob.js
Created May 11, 2016 12:23
get image url to file (Blob object)
$http.get("app/assets/images/user_dummy.jpg",{responseType: 'arraybuffer'}).then(function (res) {
let file = new Blob([res.data], { type: 'image/jpg' });
arr.push(file);
$scope.upload(arr);
})
@satishSKY
satishSKY / CameraLauncher.java
Created April 1, 2016 11:46
org.apache.cordova.camera change in real image uri
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@satishSKY
satishSKY / readme.md
Created February 3, 2016 10:37 — forked from jobsamuel/readme.md
Run NodeJS as a Service on Ubuntu 14.04 LTS

Run NodeJS as a Service on Ubuntu 14.04 LTS

With Node you can write very fast JavaScript programs serverside. It's pretty easy to install Node, code your program, and run it. But > how do you make it run nicely in the background like a true server?

  • Go to /etc/init/
  • $ sudo vim yourapp.conf
  • Paste script.conf
  • $ sudo start yourapp
  • And when you wanna kill the process $ sudo stop yourapp
<button on-tap="hellobtn()" class="button button-calm ion-ios-cart" style="bottom:10px; right: 10px; border-radius:20px; min-width: 40px; min-height: 40px; z-index: 9999; position: absolute;"></button>
@satishSKY
satishSKY / Versioning-of-js-and-css
Created January 29, 2016 09:00
Give dynamic versioning for css and js files by using javascript.
Versioning-of-js-and-css-
Give dynamic versioning for css and js files by using javascript.
var jsVersion = parseInt(Math.random()*1000000000); var script = document.getElementsByTagName('script'); var link = document.getElementsByTagName('link'); for (var int = 0; int < link.length; int++) { link[int].href = link[int].href + "?ver=" + jsVersion; console.log(link[int].href); }
for (var int = 0; int < script.length; int++) { script[int].src = script[int].src + "?ver=" + jsVersion; console.log(script[int].src); }
@satishSKY
satishSKY / README.md
Created October 3, 2015 11:34 — forked from FokkeZB/README.md
URL schemes for iOS and Android (2/2)