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
#!/bin/bash | |
# Usage: ./setup_new_project.sh <project-name> <tag> | |
PROJECT_NAME=$1 | |
TAG=${2:-v1.0} # Default to v1.0 if no tag is provided | |
# Check if project name is provided | |
if [ -z "$PROJECT_NAME" ]; then | |
echo "Please provide a project name." |
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
def query_set_as_table(queryset, many_to_many_fields=None, foreign_key_fields=None, exclude_fields=None, prefetch_related=False): | |
from decimal import Decimal | |
if many_to_many_fields is None: | |
many_to_many_fields = [] | |
if foreign_key_fields is None: | |
foreign_key_fields = {} | |
if exclude_fields is None: | |
exclude_fields = [] | |
# Prefetch related data for the ManyToMany fields and select related ForeignKey fields | |
if prefetch_related: |
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
echo "Script moved, please visit:" | |
echo "https://github.com/racecarparts/dotfiles/blob/main/.util/follow_github_org_prs.sh" |
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
#include <Adafruit_DotStar.h> | |
#include <SPI.h> | |
#define NUMPIXELS 8 // Number of LEDs in strip | |
// Here's how to control the LEDs from any two pins: | |
#define DATAPIN 4 | |
#define CLOCKPIN 5 | |
Adafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BGR); |
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
1. Copy 'git-sync-fork' script code from gist | |
2. Create a file called 'git-sync-fork.sh' in any directory available to you | |
3. Paste script into this new file 'git-sync-fork.sh' and save | |
4. Source the file (in your bash profile script) `source /path/to/file/git-sync-fork.sh` | |
5. Call either function: `gh_sync_[master|develop|development]` (for auto confirmation) or `sync_upstream upstream origin` | |
Example: | |
gh_sync_master | |
gh_sync_develop |
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
function moveHangoutLinks() { | |
var calendarId = 'YOUR CALENDAR ID'; | |
var now = new Date(); | |
var events = Calendar.Events.list(calendarId, { | |
timeMin: now.toISOString(), | |
singleEvents: true, | |
orderBy: 'startTime', | |
maxResults: 10 | |
}); | |
if (events.items && events.items.length > 0) { |