Steps to deploy Node.js to VPS using PM2 and Github Actions
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
| /* | |
| NOTE: This code assumes a bare git repo in ./bare-git/, | |
| which should have at least one text file in its root, | |
| named "greetings.txt". | |
| This code updates the contents of a "greetings.txt" | |
| file, and creates a new file called "greetings-XXX.txt" | |
| (with XXX being a random number). It then creates a new | |
| commit for these changes. Finally, it reads and dumps | |
| the new current contents of the repo, file by file. |
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.
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
| /** | |
| * Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
| * It was requested to be introduced at as part of the jsonwebtoken library, | |
| * since we feel it does not add too much value but it will add code to mantain | |
| * we won't include it. | |
| * | |
| * I create this gist just to help those who want to auto-refresh JWTs. | |
| */ | |
| const jwt = require('jsonwebtoken'); |
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
| declare var __DEV__: boolean; | |
| declare module 'react-native' { | |
| declare type Color = string | number; | |
| declare type Transform = | |
| { perspective: number } | | |
| { scale: number } | | |
| { scaleX: number } | |
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
| [ | |
| { | |
| "value": -12, | |
| "text": "(GMT -12:00) Eniwetok, Kwajalein" | |
| }, | |
| { | |
| "value": -11, | |
| "text": "(GMT -11:00) Midway Island, Samoa" | |
| }, | |
| { |
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
| import WebKit | |
| class NativeWebViewController: UIViewController { | |
| let viewportScriptString = "var meta = document.createElement('meta'); meta.setAttribute('name', 'viewport'); meta.setAttribute('content', 'width=device-width'); meta.setAttribute('initial-scale', '1.0'); meta.setAttribute('maximum-scale', '1.0'); meta.setAttribute('minimum-scale', '1.0'); meta.setAttribute('user-scalable', 'no'); document.getElementsByTagName('head')[0].appendChild(meta);" | |
| let disableSelectionScriptString = "document.documentElement.style.webkitUserSelect='none';" | |
| let disableCalloutScriptString = "document.documentElement.style.webkitTouchCallout='none';" | |
| override func viewDidLoad() { | |
| // 1 - Make user scripts for injection |
- Create or find a gist that you own.
- Clone your gist (replace
<hash>with your gist's hash):# with ssh git clone git@gist.github.com:<hash>.git mygist # with https
git clone https://gist.github.com/.git mygist
NewerOlder
