Skip to content

Instantly share code, notes, and snippets.

View bantya's full-sized avatar
🎯
Focussing

Rahul Thakare bantya

🎯
Focussing
  • http://127.0.0.1:4200
  • http://127.0.0.1:8080
  • 19:02 (UTC +05:30)
  • X @rkkth
View GitHub Profile
@bantya
bantya / debug.css
Created April 28, 2017 19:13 — forked from donatj/debug.css
Pure CSS Debuggery
*[class]:before {
position: absolute;
background: rgba(10,10,10,.6);
padding: 10px;
border-radius: 4px;
color: white;
font-size: 10px;
display: block;
content: "[" attr(class) "] " ;
}
@bantya
bantya / ColorCLI.php
Created April 28, 2017 19:16 — forked from donatj/ColorCLI.php
Simple CLI color class
<?php
class ColorCLI {
static $foreground_colors = array(
'bold' => '1', 'dim' => '2',
'black' => '0;30', 'dark_gray' => '1;30',
'blue' => '0;34', 'light_blue' => '1;34',
'green' => '0;32', 'light_green' => '1;32',
'cyan' => '0;36', 'light_cyan' => '1;36',
@bantya
bantya / PhpCLIProgressBar.php
Last active February 19, 2019 12:46
Php: CLI progress bar examples
<?php
# https://gist.github.com/nicklasos/7b83682aedf4198be9c0
# Progress: 49%
function simple_progress($text, $value)
{
echo "\r{$text}: {$value}%";
flush();
}
@bantya
bantya / LayoutChecker.js
Last active April 30, 2017 17:07
JS: CLI fun using javascript and Browser dev tools
// https://www.sitepoint.com/command-line-api-fun-profit/
// Debug the webpage and check that if the layout is as per desire or not.
[].forEach.call($$("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)});
// Extract all the image sources of a web site
var pics = $$("img");
// var pics = $$("img.-cx-PRIVATE-Photo__image"); // instagram images
for (pic in pics) {
console.log(pics[pic].src);
}
@bantya
bantya / PluginStructure.js
Created May 2, 2017 09:56
JS: Basic pure js plugin structure
(function () {
// Define the constructor
this.Modal = function () {
// Create global element references
this.closeButton = null;
this.modal = null;
this.overlay = null;
// Define options defaults
@bantya
bantya / custom_error_handler.php
Created June 14, 2017 10:26
PHP: Custom error and exception handler
<?php
error_reporting(E_ALL);
set_error_handler('errorHandler');
set_exception_handler('exceptionHandler');
function errorHandler ($level, $message, $file, $line)
{
if (error_reporting() !== 0) { // to keep the @ operator working
throw new \ErrorException($message, 0, $level, $file, $line);
@bantya
bantya / change_win_def_font.reg
Created June 15, 2017 03:47
REG: Change windows default system font
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Segoe UI (TrueType)"=""
"Segoe UI Black (TrueType)"=""
"Segoe UI Black Italic (TrueType)"=""
"Segoe UI Bold (TrueType)"=""
"Segoe UI Bold Italic (TrueType)"=""
"Segoe UI Emoji (TrueType)"=""
"Segoe UI Historic (TrueType)"=""
@bantya
bantya / cdir.bat
Last active October 31, 2022 17:53
BAT: My custom bat commands to make life easier.
@echo off
:: Author: Rahul Thakare
:: Email: [email protected]
:: Github: www.github.com/bantya
:: Purpose: Easy change directory command for cmd
:: Created: 23062017
set Dir=%1
@bantya
bantya / custom_cmd_prompt.win-env
Last active January 21, 2018 17:13
Win Env: My custom cmd prompt
:: Author: Rahul Thakare
:: Email: [email protected]
:: Github: www.github.com/bantya
::
:: To have custom cmd prompt.
bantya @ thAKare$S::$S[$p]$_$$$S
bantya @ thAKare :: [C:\Users\thAKare]
$ _
@bantya
bantya / queries.sql
Created June 18, 2017 06:44 — forked from alsma/queries.sql
Many-to-many interview question
-- select all query --
SELECT b.bookTitle, a.authorName FROM book b
INNER JOIN author_book ab ON ab.bookID = b.bookID
INNER JOIN author a ON a.authorID = ab.authorID
ORDER BY b.bookTitle
-- select all with authors concantenated --
SELECT b.bookTitle, GROUP_CONCAT(a.authorName) authors FROM book b