Skip to content

Instantly share code, notes, and snippets.

@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active January 16, 2025 11:41
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@MaximKotliar
MaximKotliar / AVPlayerDelegate.swift
Last active January 16, 2025 11:37
A easier way to handle AVPlayer's events
// AVPlayerDelegate.swift
//
// Created by Maxim Kotliar on 7/30/18.
//
import AVFoundation
@objc protocol AVPlayerDelegate: class {
@objc optional func playerDidStartPlayback()
@objc optional func playerDidPausePlayback()
@yepbro
yepbro / gist:1a0764b849216e4a490e21c590abb17a
Last active January 16, 2025 11:34
Moonshine & Laravel Modules (nwidart)
<?php
/**
* How to integrate Moonshine Admin Panel and Laravel (Nwidart) modules?
*
* I would like to be able to store ModelResources in the module folder and then add them to the admin
* panel and menu from there.
*
* Moonshine 3, Laravel Modules 11, PHP 8.4
*
* @link https://moonshine-laravel.com/
@devomman
devomman / activate-office-windows-mac.md
Last active January 16, 2025 11:31
Microsoft Office Active or Windows Activation | Microsoft Office Activate for Mac - Free Guide

✅ Activate Microsoft Office or Windows

💠 Windows User:

  1. Download OS & Office Link: https://files.rg-adguard.net/version/5f2ad9c6-e111-76e8-06d1-56d44c136bae
  2. Open PowerShell (Not CMD). To do that, right-click on the Windows start menu and select PowerShell or Terminal.
  3. Copy and paste the code below and press enter
irm https://get.activated.win | iex
  1. You will see the activation options.
@rxaviers
rxaviers / gist:7360908
Last active January 16, 2025 11:29
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@kvaps
kvaps / rspamd-lists.md
Last active January 16, 2025 11:28
Howto create local whitelists and blacklists for Rspamd

Local whitelists and blacklists for Rspamd

  • cd /etc/rspamd
  • create rspamd.conf.local
  • create lists:
touch local_bl_from.map.inc local_bl_ip.map.inc local_bl_rcpt.map.inc \
local_wl_from.map.inc local_wl_ip.map.inc local_wl_rcpt.map.inc
  • change permissions:
@yifanzz
yifanzz / code-editor-rules.md
Created December 17, 2024 00:01
EP12 - The One File to Rule Them All

[Project Name]

Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

Project Context

[Brief description ]

  • [more description]
  • [more description]
  • [more description]
@Splode
Splode / Laravel-Scheduler-Windows.md
Last active January 16, 2025 11:27
Laravel Scheduler on Windows

Run Laravel Scheduled Tasks on Windows

The following are instructions for running scheduled tasks defined in a Laravel project on Windows. The Laravel documentation provides instructions for running scheduled tasks using cron jobs on Linux systems. However, cron jobs are not available on Windows. The built-in Windows Task Scheduler can be used to run scheduled tasks instead.

Create a Scheduled Task

  1. Open Task Scheduler
  2. Select Create Task...
  3. Give the task a name and description
  4. To run the task in the background, select Run whether the user is logged on or not and check the Hidden checkbox.
@jgcmarins
jgcmarins / react-native-upgrade.md
Last active January 16, 2025 11:27 — forked from julioxavierr/react-native-update.md
Steps to Upgrade a React Native App

React Native Upgrade Path

  1. Change React and React Native versions in package.json
  2. Run yarn install to upgrade dependencies
  3. Run yarn outdated or yarn upgrade-interactive to upgrade outdated libraries. Make sure that there's no breaking changes, check release notes (one by one).
  4. Compare your changes with the diff or use the upgrade-helper and update the native code.
  5. Open Xcode and link the binaries
  6. Run iOS
  7. Test iOS
  8. Run on Android
  9. Test Android
@nocturn9x
nocturn9x / mizip_util.py
Last active January 16, 2025 11:26
A simple tool to tinker with MiZip Mifare tags. It can generate sector(s) decryption keys as well as modified dump files to alter a tag's balance. If you know what you're doing, you can even use this tool to transform any Mifare 1K/4K tag (and probably others using the same scheme) into a "MiZip-compatible" tag recognizable by vending machines
#!/usr/bin/env python
# Copyright 2021 Mattia Giambirtone & All Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software