Skip to content

Instantly share code, notes, and snippets.

View ronisaha's full-sized avatar

Roni Saha ronisaha

View GitHub Profile
@ronisaha
ronisaha / backup.bat
Created April 5, 2017 18:33
Backup restore MySQL(Windows)
@echo off
TITLE MySQL Backup Executor
:: Change the values that match your environment
SET backup_dir=D:\mysql_daily_backups\
SET mysqldb=zxy_mis
SET mysqlpassword=123456
SET mysqluser=root
SET mysqlpath=mysqldump
@ronisaha
ronisaha / gitrmtags.sh
Last active August 17, 2017 17:38
Remove all tags(local and remote) from git repository
#!/bin/sh
git tag -d $(git tag -l)
#Fetch remote tags.
git fetch
#Delete remote tags.
git push origin --delete $(git tag -l) # Pushing once should be faster than multiple times
#Delete local tags.
git tag -d $(git tag -l)
@ronisaha
ronisaha / index.html
Created August 20, 2017 15:28 — forked from StickyCube/index.html
Electron click through transparency example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test App</title>
</head>
<style>
html, body {
height: 100%;
@ronisaha
ronisaha / composer.json
Created October 28, 2017 08:08 — forked from jaytaph/composer.json
Using the Symfony security component as standalone
{
"name": "jaytaph/security-example",
"require": {
"symfony/security-core": "~2.8"
},
"authors": [
{
"name": "Joshua Thijssen",
"email": "jthijssen@noxlogic.nl"
}
@ronisaha
ronisaha / wordpress-plugin-svn-to-git.md
Created November 9, 2017 02:11 — forked from kasparsd/wordpress-plugin-svn-to-git.md
Using Git with Subversion Mirroring for WordPress Plugin Development
@ronisaha
ronisaha / main.component.ts
Created April 24, 2018 04:06 — forked from soyuka/main.component.ts
RxRest in an angular / api-platform context using jsonld and hydra
import { NgModule, Component, OnInit } from '@angular/core'
import { AngularRxRest, AngularRxRestConfiguration } from './rxrest'
@Component({
selector: 'prefix-main',
template: '<prefix-foo></prefix-foo>'
})
export class MainComponent implements OnInit {
loading: boolean = false
loggedIn: boolean = false
@ronisaha
ronisaha / FeatureContext.php
Created September 16, 2018 07:22 — forked from jakzal/FeatureContext.php
Generating schema before Behat scenarios in Symfony2
<?php
namespace Behat\CommonContext;
use Behat\BehatBundle\Context\BehatContext;
use Behat\Behat\Event\ScenarioEvent;
use Doctrine\ORM\Tools\SchemaTool;
/**
* Provides hooks for building and cleaning up a database schema with Doctrine.
@ronisaha
ronisaha / IdGenerator.php
Last active June 19, 2025 03:50
Snowflake IdGenerator implementation in php
<?php
/**
* Snowflake implementation in php
*
* @author Roni Saha <roni.cse@gmail.com>
*/
class IdGenerator
{
private static $_instance;
@ronisaha
ronisaha / window-controller.js
Created March 4, 2020 02:58
Inter tab messaging library
"use strict";
var WindowController = (function () {
function WindowController() {
this.id = Math.random();
this.callbacks = {};
window.addEventListener('storage', this, false);
window.addEventListener('unload', this, false);
}
WindowController.prototype.handleEvent = function (event) {
if (event.type === 'unload') {
@ronisaha
ronisaha / check_docker_container.sh
Created May 23, 2020 02:01 — forked from ekristen/check_docker_container.sh
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not