Skip to content

Instantly share code, notes, and snippets.

View ronisaha's full-sized avatar

Roni Saha ronisaha

View GitHub Profile
@ronisaha
ronisaha / tmt20ii_status.php
Created August 5, 2016 16:30 — forked from defacto133/tmt20ii_status.php
Get TM-T20II Epson ASB status through UDP socket
/*
* $status = {
* "status": "online" | "offline",
* "cover": "open" | "closed", (opt)
* "feeding": "feeding" | "not", (opt)
* "autocutterError": "error" | "not", (opt)
* "unrecoverableError": "error" | "not", (opt)
* "recoverableError": "error" | "not", (opt)
* "paper": "paperEnd" | "paperPresent" (opt)
* }
@ronisaha
ronisaha / Remove all git tags
Created August 13, 2016 01:55 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@ronisaha
ronisaha / get_title_and_url.applescript
Created August 17, 2016 03:21 — forked from vitorgalvao/Get Title and URL.applescript
Applescript to get frontmost tab’s url and title of various browsers.
# Keep in mind that when asking for a `return` after another, only the first one will be output.
# This example is meant as a simple starting point, to show how to get the information in the simplest available way.
# Google Chrome
tell application "Google Chrome" to return URL of active tab of front window
tell application "Google Chrome" to return title of active tab of front window
# Google Chrome Canary
tell application "Google Chrome Canary" to return URL of active tab of front window
tell application "Google Chrome Canary" to return title of active tab of front window
# Chromium
@ronisaha
ronisaha / bn_url_slug.php
Last active March 5, 2017 13:41 — forked from sgmurphy/url_slug.php
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
function url_slug($string = null, $separator = "-") {
if (is_null($string)) {
return "";
}
// Remove spaces from the beginning and from the end of the string
$string = trim($string);
@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 / 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