This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Script to convert old bash history format to zsh history format. | |
| Old format: "1 17.11.2023 14:57 command_executed" | |
| New format: ": 1753098256:0;command_executed" | |
| """ | |
| import re | |
| import sys | |
| from datetime import datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template name="bool:default" value="/** * @var bool * @ORM\Column(type="boolean", options={"default": $default$}) */ private bool $$$name$ = $default$; $END$ public function is$method$(): bool { return $this->$name$; } public function set$method$(bool $$$name$): void { $this->$name$ = $$$name$; }" description="boolean column" toReformat="false" toShortenFQNames="true"> | |
| <variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="default" expression="enum("false", "true")" defaultValue="" alwaysStopAt="true" /> | |
| <variable name="method" expression="capitalize(name)" defaultValue="" alwaysStopAt="false" /> | |
| <context> | |
| <option name="PHP Class Member" value="true" /> | |
| </context> | |
| </template> | |
| <template name="bool:nullable" value="/** * @var bool|null * @ORM\Column(type="boolean", nullable=true) */ private ?bool $$$name$ = nul |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| element.addEventListener('animationend', function(event){ | |
| if(event.target !== element) return; | |
| element.classList.remove('error'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param {HTMLElement} element | |
| * @param {Keyframe[] | PropertyIndexedKeyframes} to | |
| * @param {KeyframeAnimationOptions} options | |
| */ | |
| export function animateTo(element, keyframes, options) { | |
| const anim = element.animate( | |
| keyframes, | |
| { ...options, fill: 'both' }, | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git rev-list --all | xargs git grep -F 'code_to_search' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Most of the time, it's safe to delete all the untracked files. But many times, there is a situation wherein you want to delete, but also to create a backup of your untracked files just in case you need them later. | |
| # Git, along with some Bash command piping, makes it easy to create a zip archive for your untracked files. | |
| git ls-files --others --exclude-standard -z | xargs -0 tar rvf ~/backup-untracked.zip | |
| # The above command makes an archive (and excludes files listed in .gitignore) with the name backup-untracked.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :root { | |
| --ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53); | |
| --ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19); | |
| --ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22); | |
| --ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06); | |
| --ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035); | |
| --ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335); | |
| --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94); | |
| --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1); | |
| --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # UNIX | |
| date -d @1577836800 | |
| # OSX | |
| date -r 1577836800 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DELETE pm | |
| FROM wp_postmeta pm | |
| LEFT JOIN wp_posts wp ON wp.ID = pm.post_id | |
| WHERE wp.ID IS NULL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Country list ISO-3166-1 (ALPHA 2) in french | |
| */ | |
| function countries() { | |
| $countries = array( | |
| 'AF' => 'Afghanistan', | |
| 'ZA' => 'Afrique Du Sud', | |
| 'AX' => 'Åland, Îles', |
NewerOlder