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
  • 04:43 (UTC -12:00)
  • X @rkkth
View GitHub Profile
@theodorejb
theodorejb / convert_array_access_braces.php
Last active March 27, 2024 18:22
Migrate deprecated curly brace array access syntax to bracket syntax. Requires PHP 7.4.
<?php
error_reporting(E_ALL);
$opts = getopt('f:d:rb:', ['ext:', 'php:', 'diff::']);
if ((int)isset($opts['d']) + (int)isset($opts['f']) !== 1) {
$self = basename(__FILE__);
echo <<<EOF
Usage:
php $self -f<php_script> [-b] [--php <path_to_php>] [ --diff [<file>]]
@JustinGrote
JustinGrote / Search-Giphy.ps1
Last active December 23, 2022 16:18
Get a random gif from Giphy. ***NOTE: Invoke-TerminalGif was moved to MSTerminalSettings module***
#requires -module msterminalsettings,threadjob
###QUICKSTART
#FIRST: Run this in your Powershell Windows Terminal: Install-Module threadjob,msterminalsettings -scope currentuser
#THEN: iex (iwr git.io/invoketerminalgif)
#THEN: Get-Help Search-Giphy -Examples
#THEN: Get-Help Invoke-TerminalGif -Examples
#THEN: Search-Giphy | Format-List -prop *
#THEN: Invoke-TerminalGif https://media.giphy.com/media/g9582DNuQppxC/giphy.gif
@GDreyV
GDreyV / xd.json.service.ts
Last active December 9, 2019 15:18
Convert Xd scenegraph to JSON format
import scenegraph from "scenegraph";
class ConvertOptions {
// skip iterating over nested nodes to prevent infinite loop
public doNotExpandNodes = false;
}
/**
* Converts xd nodes into json object
*/
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 15, 2024 20:11
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@Kieranties
Kieranties / config
Last active August 22, 2019 09:42
Git Next - Simple alias for presenting when using a git repo - https://blog.kieranties.com/2019/04/06/git-next
[alias]
start = "!f() { \
baseTag='1'; \
startTag=$1; \
selectedTag=${startTag:-${baseTag:-startTag}}; \
git reset --hard $selectedTag; \
git clean -df; \
git tag -l $selectedTag -n999; \
}; f"
next = "!f() { \
@kalpeshsingh
kalpeshsingh / pre-push
Last active April 26, 2024 04:31
A pre-push git hook that notify Amazon Chime group
#!/bin/sh
branch="$(git rev-parse --abbrev-ref HEAD)"
# get computer name to append in Chime message
username=$USER
# a branch name where you want to prevent git push. In this case, it's "master"
if [ "$branch" = "master" ]; then
echo "You can't commit directly to '"${branch}"' branch" # webstorm or intellij will show this as popup
@riverar
riverar / features.json
Last active November 8, 2023 20:46
Quick n' dirty hack to enable Your Phone remoting, notification and other experiments
{
"AATes123": true,
"AcrylicAndBackground": true,
"AudioInfoSync": true,
"BatteryIndicator": true,
"CallingDiscoveryTimeout": 30,
"CallingEnableOnARM": true,
"CallingFromMessages": true,
"CallingLabelInProd": true,
"CallingNode": true,
@disulfidebond
disulfidebond / create_restore_dmg_macosx.md
Last active February 26, 2024 19:19
Create or Restore Disk Image in Mac OSX

Overview

This gist details how to create or restore a disk image in Mac OSX. There are three methods that are described: Carbon Copy Cloner, Disk Utility, and CommandLine.

  • Disclaimer:
    • I have no financial incentives to https://bombich.com or Apple.
    • Always make a backup of your data, and make 2 separate backups before trying something new.
    • The following steps have been tested and are a summary of my personal recommendations, but should be used at your own risk.
    • If there is a chance of imminent data loss, contact a professional for assistance, and do not rely on a random person from the Internet for help.

Method 1: Carbon Copy Cloner (CCC)

@redestructa
redestructa / TablePrinter.php
Created February 13, 2019 10:42
The table Printer class has no dependencies and generates an array out of an object array
<?php
/**
* The table Printer class has no dependencies and generates an array (strings)
* out of an object array / countable and the child properties that should be printed given by an array (strings)
*/
class TablePrinter
{
/**
* @param \Countable|array|object[] $historyItems
@xenogenesi
xenogenesi / Makefile
Last active November 19, 2021 03:28
create self signed certificates
DOMAIN ?= mydomain.com
COUNTRY := IT
STATE := IT
COMPANY := Evil Corp.
# credits to: https://gist.github.com/fntlnz/cf14feb5a46b2eda428e000157447309
# usage: