Discover gists
/** | |
-NOTE: | |
After AVPlayerItem faces an error you can create CoreMedia Error from the underlying Error inside AVPlayerItem error. | |
With the `CoreMediaError` enum, you can convert errors to more readable ones,handle AVPlayerItem Common errors, | |
and show the proper messages to your users. | |
**/ | |
public enum CoreMediaError:Error { |
Não é possível desfazer um push diretamente, como é feito com o commit utilizando o comando $ git reset --soft|mixed|hard hash-do-penultimo-commit
Para desfazer um push são necessários 3 passos:
- Utilizar o comando
$ git reset --mixed HEAD~1
e em seguida utilizar o comando$ git stash
(se preferir pode usar a opção-m "revertendo o push blablabla"
para salvar o stash com um contexto do que foi feito - Utilizar o comando
$ git revert HEAD~0
- Utilizar o comando
$ git stash apply
- Utilizar o comando
$ git push origin sua-branch -f
@ECHO OFF | |
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK | |
if NOT EXIST Private goto MDPrivate | |
:CONFIRM | |
echo Are you sure to lock this folder? (Y/N) | |
set/p "cho=>" | |
if %cho%==Y goto LOCK | |
if %cho%==y goto LOCK | |
if %cho%==n goto END | |
if %cho%==N goto END |
<?php | |
/** | |
* Converts the WooCommerce country codes to 3-letter ISO codes | |
* https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3 | |
* @param string WooCommerce's 2 letter country code | |
* @return string ISO 3-letter country code | |
*/ | |
function kia_convert_country_code( $country ) { | |
$countries = array( | |
'AF' => 'AFG', //Afghanistan |
# -------- | |
# Hardware | |
# -------- | |
# Opcode - operational code | |
# Assebly mnemonic - abbreviation for an operation | |
# Instruction Code Format (IA-32) | |
# - Optional instruction prefix | |
# - Operational code |
I recently decided to order an arduino nano and a tft display from AliExpress. When I looked up online it took me some time to find a clear guide how to connect the display to the arduino, either the display had different pins or it was a slightly different model, but with some trial and error, I managed to get it to work.
- 1x Arduino Nano
- 1x AdaFruit 1.3" 240x240 ST7789 display
- 6x jumper wires or whatever else you can use to connect
This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
Convert .mov/.MP4 to .gif
As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.
This is not limited to developer, anyone has this need can use this method to convert the files.
It's quite straightforward to use GitLab Pages to deploy a Storybook instance per branch (and remove it whenever the branch will be removed). And yeah, it's irony to document this in a GitHub Gist 😅
You just need a .gitlab-ci.yml
like this one:
stages:
- setup
- build-and-test
- deployment
- pages
/* | |
Disable the "Admin Change" emails in Paid Memberships Pro | |
*/ | |
function my_pmpro_email_recipient($recipient, $email) | |
{ | |
if($email->template == "admin_change" || $email->template == "admin_change_admin") //could check for a different template here | |
$recipient = NULL; | |
return $recipient; | |
} | |
add_filter("pmpro_email_recipient", "my_pmpro_email_recipient", 10, 2); |