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 branch --merged | grep -vE "(^\*|main)" | xargs git branch -d |
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
| #!/bin/sh | |
| BASE_PROMPT="You are a terminal-savvy assistant. | |
| When answering questions, always output the commands first, prefixed by RUN: and wrapped in backticks. | |
| Do not include RUN inside backticks, only the command. Explain everything but only after you list them out. | |
| I'll be reading the response with a script so it's imperative you list them with RUN: first. | |
| Prefer single commands as much as you can. | |
| For example you can output something like: | |
| RUN: `df -h` |
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
| #!/bin/bash | |
| xclip -sel c < $@ |
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
| #!/bin/bash | |
| $PWD/vendor/bin/sail $@ |
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
| # Personal GitHub account | |
| Host github.com | |
| HostName github.com | |
| User git | |
| IdentityFile ~/.ssh/id_ed25519_personal | |
| # Work GitHub account | |
| Host github.com-work | |
| HostName github.com | |
| User git |
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
| /** | |
| Instructions: | |
| You may just copy the whole code and execute this on the browser console or include this to a node | |
| project that has [JSDOM](https://github.com/jsdom/jsdom) to run it in the terminal. | |
| Requirements: | |
| A node is either a string, or a JS object of the form {"name": "a name", "nodes": [more, nodes]} | |
| Write a function in javascript that converts an array of nodes into an unordered list in HTML | |
| function mySample(arrayOfNodes) {...; return html} |
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
| [/] | |
| default='eba4372c-5679-447c-a555-209467495819' | |
| list=['eba4372c-5679-447c-a555-209467495819'] | |
| [:eba4372c-5679-447c-a555-209467495819] | |
| background-color='rgb(34,34,34)' | |
| background-transparency-percent=2 | |
| foreground-color='rgb(236,236,236)' | |
| palette=['rgb(46,52,54)', 'rgb(186,20,20)', 'rgb(78,154,6)', 'rgb(196,160,0)', 'rgb(52,101,164)', 'rgb(117,80,123)', 'rgb(6,152,154)', 'rgb(211,215,207)', 'rgb(85,87,83)', 'rgb(226,87,87)', 'rgb(138,226,52)', 'rgb(252,233,79)', 'rgb(114,159,207)', 'rgb(173,127,168)', 'rgb(52,226,226)', 'rgb(238,238,236)'] | |
| use-theme-colors=false |
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
| server { | |
| listen 80; | |
| server_name dev.your-app.com; | |
| server_tokens off; | |
| location / { | |
| return 301 https://$host$request_uri; | |
| } |
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
| from datetime import datetime | |
| from collections import namedtuple | |
| Range = namedtuple('Range', ['start', 'end']) | |
| # Returns a positive number of days overlapping, otherwise, returns 0 | |
| def get_days_overlap(r1: Range, r2: Range) -> int: | |
| latest_start = max(r1.start, r2.start) | |
| earliest_end = min(r1.end, r2.end) |
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
| from io import BytesIO | |
| import boto3 | |
| import pandas as pd | |
| from os import environ | |
| def convert(bucket, key): | |
| s3_client = boto3.client('s3', region_name=environ['REGION']) | |
| s3_object = s3_client.get_object(Bucket=bucket, Key=key) |
NewerOlder