Skip to content

Instantly share code, notes, and snippets.

View younjin's full-sized avatar
Bad at responding - sorry!

Jinny younjin

Bad at responding - sorry!
View GitHub Profile
@kopiro
kopiro / telia_gb_left.sh
Last active January 14, 2022 21:06
Telia GB Left (XBar)
#!/bin/bash
# <xbar.title>Telia GB Left</xbar.title>
# <xbar.version>v1.0</xbar.version>
# <xbar.author>Flavio De Stefano</xbar.author>
# <xbar.author.github>kopiro</xbar.author.github>
# <xbar.var>string(SESSID=""): Session ID</xbar.var>
# <xbar.var>string(SUBSCRIPTION_ID=""): Subscription ID; if left blank, the first subscription found is gonna be used</xbar.var>
headers='-H "Accept: application/json" -H "X-IOS-Build: 4068" -H "ga-av: 10.10.4" -H "ga-aid: com.teliasonera.selfservice.telia" -H "User-Agent: com.teliasonera.selfservice.telia/10.10.4 (iOS 15.2; Apple)" -H "ga-an: Mitttelia"'
@mcpower
mcpower / aoc-tips.md
Last active March 27, 2024 03:28
Tips for getting on the Advent of Code leaderboard

Hi, I'm mcpower. I've done Advent of Code seriously for two years now in Python, placing 9th in 2018 and 12th in 2017. This year, I'm taking a break from aiming for the leaderboard - while it's fun and all, it is a bit stressful at times (the good kind of stress, though!). As such, I'd like to share a few tips for anyone wanting to aim for the leaderboard.

This is everything that worked for me. Your mileage may vary, though - don't take this as gospel, see what works for you.

Go fast

Go fast.

#!/usr/bin/env bash
# handle being called from systemd service
if [ -z "$XDG_RUNTIME_DIR" ] && [ -z "$SWAYSOCK" ]
then
uid=$(id -u "$USER")
export XDG_RUNTIME_DIR="/run/user/$uid/"
SWAYSOCK=$(find "$XDG_RUNTIME_DIR" -iname "sway*sock")
export SWAYSOCK
fi

Update: download the new Pokemon Go app - it fixes all of this. Download it, and reauth, and you should be set. The grant scopes and prompt are correct and visible now too! Now if only I could actually find a pikachu...

Pokemon tokens are requested with these understandable scopes:

@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@jpreardon
jpreardon / outboard.coffee
Last active October 13, 2022 07:03
Simple In/Out Board for Dashing
class Dashing.Outboard extends Dashing.Widget
ready: ->
# This is fired when the widget is done being rendered
onData: (data) ->
# Handle incoming data
# You can access the html node of this widget with `@node`
# Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in.
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@mwhite
mwhite / git-aliases.md
Last active June 11, 2024 15:56
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@embray
embray / suggest_backports.py
Last active July 26, 2019 11:41
List pull requests merged since the last tag on the given release branch which have not yet been merged into the release branch.
#!/usr/bin/env python
# I wasn't happy with any of the GitHub libraries for Python that I tried so I
# just used the GitHub API directly. If someone would like to rewrite this
# using a library please be my guest
from __future__ import unicode_literals
import argparse
import base64