Last updated: 09/05/24
Discover gists
This file contains 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
CREATE OR REPLACE FUNCTION base36_decode(IN base36 varchar) | |
RETURNS bigint AS $$ | |
DECLARE | |
a char[]; | |
ret bigint; | |
i int; | |
val int; | |
chars varchar; | |
BEGIN | |
chars := '0123456789abcdefghijklmnopqrstuvwxyz'; |
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:
This file contains 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 * as React from 'react'; | |
import { DateTime } from 'luxon'; | |
import { Calendar as CalendarIcon } from 'lucide-react'; | |
import { Button } from '@/components/ui/Button'; | |
import { Calendar } from '@/components/ui/Calendar'; | |
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/Popover'; | |
import { cn } from '@/lib/utils'; | |
import { SelectSingleEventHandler } from 'react-day-picker'; | |
import { Label } from '@/components/ui/Label'; |
This file contains 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
extension URLResponse { | |
/// Returns casted `HTTPURLResponse` | |
var http: HTTPURLResponse? { | |
return self as? HTTPURLResponse | |
} | |
} | |
extension HTTPURLResponse { | |
/// Returns `true` if `statusCode` is in range 200...299. | |
/// Otherwise `false`. |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
This file contains 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
package main | |
import ( | |
"firebase.google.com/go" | |
"cloud.google.com/go/firestore" | |
"context" | |
"log" | |
"fmt" | |
) |
- http://stackoverflow.com/questions/804115 (
rebase
vsmerge
). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebase
vsmerge
) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
reset
vscheckout
vsrevert
) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse
) - http://stackoverflow.com/questions/292357 (
pull
vsfetch
) - http://stackoverflow.com/questions/39651 (
stash
vsbranch
) - http://stackoverflow.com/questions/8358035 (
reset
vscheckout
vsrevert
)
This file contains 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
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common | |
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev | |
#Optional: so vim can be uninstalled again via `dpkg -r vim` | |
sudo apt-get install checkinstall | |
sudo rm -rf /usr/local/share/vim /usr/bin/vim | |
cd ~ |
NewerOlder