Skip to content

Instantly share code, notes, and snippets.

View philshem's full-sized avatar
💭
🐙

@philshem philshem

💭
🐙
View GitHub Profile
@l3nz
l3nz / README.md
Last active August 8, 2023 05:54
NOT Fixed: accountsd using 400% CPU on MacOS Catalina 10.15.7 (19H2)

accountsd using 400% CPU on MacOS Catalina 10.15.7 (19H2)

TL;DR: Still open - see below.

This morning I woke up to some not-so-nice surprise - my 2018 MPB 13" would be kind of totally unusable. The accountsd process was stable at 400%, battery was going like ice-cream in the Sahara, and opening up LibreOffice was like a major achievement.

I did check the logs (that were growing at like 500 lines per second) and I saw a lot of lines at FAULT level:

fault 07:54:04.271342+0200 accountsd Unentitled access by client 'CallHistoryPlugi' (selector: accountsWithAccountType:handler:)

@dannguyen
dannguyen / README-xsv-split-windows.md
Last active August 27, 2020 07:00
How to install and use xsv to split a large CSV file (Windows)

How to use xsv (in Windows) to split up a CSV file too big for Excel

I wrote these instructions on how to install and use xsv – a powerful CSV-handling command-line tool, because someone asked how to deal with a data file that was too big to open in Excel or even Notepad. I didn't know how familiar the person was with installing/running downloadable .exe files or with Powershell, so I've tried to include some general instructions that hopefully are useful to even novices.

This mini-guide is not at all meant to be exhaustive as it basically shows just one of xsv's many useful functions. But if you're new to the idea of using command-line tools to do things, hopefully this can be a friendly intro to it.


Here's an example of a CSV that, at 3 million rows, is too big for Excel to open: https://burntsushi.net/stuff/worldcitiespop.csv

@interrogator
interrogator / fline.py
Last active May 15, 2020 06:46
first line support
#!/usr/bin/env python
"""
Utility to generate a first-line support message for a user who has submitted a roundup issue.
To only ever be one-file to discourage feature creep for a small utility.
The only main extensions I'd really consider are automatically posting this message to roundup,
but I don't think this is a good idea, as you may need to generate a couple of messages till
an appropriate one is generated
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aagarw30
aagarw30 / app.R
Last active January 5, 2023 16:05
Upload zip folder and unzip it using R and Shiny
library(shiny)
ui <- fluidPage(
# Upload zip files
fileInput("file", "Upload Zip file", accept = ".zip"),
# action button to unzip the file
actionButton("unzip", "Unzip Files"),
# to display the metadata of the zipped file
tableOutput("filedf"),
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
import gpxpy
import gpxpy.gpx
import folium
gpx_file = open('path_to_gpx_file.gpx', 'r')
gpx = gpxpy.parse(gpx_file)
points = []
for track in gpx.tracks:
for segment in track.segments:
@dannguyen
dannguyen / catdrawer-youtube-to-gif-README.md
Last active September 6, 2024 12:22
Using youtube-dl and gifify from the command-line to make a cat gif
@bonzanini
bonzanini / search_biopython.py
Last active May 19, 2024 08:45
Searching PubMed with Biopython
# This code uses Biopython to retrieve lists of articles from pubmed
# you need to install Biopython first.
# If you use Anaconda:
# conda install biopython
# If you use pip/venv:
# pip install biopython
# Full discussion: