Skip to content

Instantly share code, notes, and snippets.

@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active April 19, 2024 13:25
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@scriptdev
scriptdev / .php
Last active April 19, 2024 13:24
CÁLCULO PORCENTAGEM
<?php
$valor_total = (double) str_replace(',', '.', str_replace('.', '', $param['valor_total']));
$porcentagem = (double) str_replace(',', '.', str_replace('.', '', $param['porcentagem']));
# 1º EXEMPLO
$resultado = ($valor_total * $porcentagem) / 100;
# 2º EXEMPLO
@scriptdev
scriptdev / .php
Created September 2, 2022 18:54
DROPDOWN MENU
<?php
$dropdown = new TDropDown("RELATÓRIOS", 'far:file-alt #000000');
$dropdown->setPullSide('left');
$dropdown->setButtonClass('btn btn-sm btn-default dropdown-toggle');
$btn = $dropdown->addAction("CLIENTES", new TAction(['RelatorioClientes', 'onShow']), 'fas:print #000000');
$btn = $dropdown->addAction("PRODUTOS", new TAction(['RelatorioProdutos', 'onShow']), 'fas:print #000000');
$this->form->addFooterWidget($dropdown);
@zchee
zchee / actionlist.vim
Last active April 19, 2024 13:22
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@scriptdev
scriptdev / .php
Created September 3, 2022 17:24
FOCO AUTOMÁTICO NO THtmlEditor
<?php
TScript::create("$(‘.thtmleditor’).summernote({focus: true});", true, 100);
@scriptdev
scriptdev / .php
Last active April 19, 2024 13:22
CUSTOMIZAR O LAYOUT DO TFullCalendar
<?php
$this->fc->setOption('headerToolbar', [
'start' => 'today', // 'start' => 'today prev,next',
'center' => 'title',
'end' => 'dayGridMonth,timeGridWeek,timeGridDay'
]);
# https://fullcalendar.io/docs
@scriptdev
scriptdev / .php
Created September 5, 2022 03:55
MOSTRAR APENAS OS REGISTROS VINCULADOS AO USUÁRIO LOGADO
<?php
public function onReload($param = NULL)
{
try
{
TTransaction::open(self::$database);
$repository = new TRepository(self::$activeRecord);
@natemccurdy
natemccurdy / manual_code_deploy.sh
Last active April 19, 2024 13:21
Manually trigger code-manager and file-sync
#!/bin/bash
# GIST_URL: https://gist.github.com/natemccurdy/797fa9128b7eef1f07be
# This script can be run to manually trigger Code Manager to deploy code from your control-repo. This sort of
# thing is neccesary when, for example:
# - You've turned on Code Manager but have not yet made an RBAC token.
# - You want to pull down the latest version of a Puppetfile module without pushing to your GMS.
# - Something has broken the post-receive hook on your GMS that would've triggered Code Manager.
# - Syntax errors in your Puppetfile prevent you from retrieving those fixes to that Puppetfile.
# - Puppetserver has crashed due to file-sync issues between code and code-staging.
# - Code Manager can't deploy your code for various reasons that are hard to track down.
@scriptdev
scriptdev / .php
Created September 5, 2022 03:57
MOSTRA OS REGISTROS DIFERENTES DO USUÁRIO LOGADO
<?php
public function onReload($param = NULL)
{
try
{
TTransaction::open(self::$database);
$repository = new TRepository(self::$activeRecord);
@HimDek
HimDek / Install Windows Subsystem for Android on any Edition of Windows 11 non Insider.md
Last active April 19, 2024 13:20
This Guide will show you how to Install Windows Subsystem for Android or WSA on any Edition of Windows 11 non Insider release.

Install Windows Subsystem for Android on Windows 11 non Insider

WSA or Windows Subsystem for Android is a Tool that allows Windows to run Android Apps directly without using any emulator. The problem is Windows Subsystem for Android is currently only available through preview via the Beta Channel of the Windows Insider Program. But if you follow this guide, you don't have to be in Windows Insider Program to try it out. The only thing you need is Windows 11 installed and some patience.

Prerequisites:

  • A Device with any version and Edition of Windows 11 installed.
  • Internet Connection.
  • Hyper-V enabled.

Enable Hyper-V: