Skip to content

Instantly share code, notes, and snippets.

View jwmann's full-sized avatar
🎯
Focusing

James W Mann jwmann

🎯
Focusing
View GitHub Profile
@wosephjeber
wosephjeber / git_revision.js
Last active February 23, 2024 15:20
Get branch and commit names from Node (synchronously)
const { execSync } = require('child_process');
function executeGitCommand(command) {
return execSync(command)
.toString('utf8')
.replace(/[\n\r\s]+$/, '');
}
const BRANCH = executeGitCommand('git rev-parse --abbrev-ref HEAD');
const COMMIT_SHA = executeGitCommand('git rev-parse HEAD');
@adisib
adisib / youtube_hd.user.js
Last active April 24, 2024 07:40
Make youtube videos in HD and automatically resize
// ==UserScript==
// @name Youtube HD
// @author adisib
// @namespace namespace_adisib
// @description Select a youtube resolution and resize the player.
// @version 2024.01.17
// @match https://*.youtube.com/*
// @noframes
// @grant GM.getValue
// @grant GM.setValue
@vannmangel
vannmangel / Remove-SkypeAds.ps1
Last active January 14, 2021 11:54
Remove ads in skype
# start as admin!
# prompt for username
$SkypeUserName = Read-Host -Prompt "What is your Skype username?"
# stop skype-process
try{
if(Get-Process | ? {$_.Name -like 'skype'}) {Stop-Process -Name skype}
# commit changes to hosts file
$hostfile = "C:\Windows\System32\Drivers\etc\hosts"
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@andrewroberts
andrewroberts / Log.gs
Last active January 4, 2020 14:32
A simple wrapper for the BetterLog Google Apps Script Library - GAS Library MqTFuiXcPtS5rVUZ_jC9Z4tnfWGfgtIUb
// 34567890123456789012345678901234567890123456789012345678901234567890123456789
// JSHint: 22 March 2015 08:56 GMT
// Unit Tests: 22 March 2015 08:50 GMT
/*
* Copyright (C) 2015-2017 Andrew Roberts (andrew@roberts.net)
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 25, 2024 16:50
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@corradomatt
corradomatt / gravityforms-bs-datepicker.less
Last active November 28, 2023 20:34
Addon for using gravity forms with a bootstrap based development such as the roots.io theme for WordPress. I specifically wrote this for a roots theme and it's based on this post http://roots.io/style-gravity-forms-with-bootstrap/ by Ben Word.This goes one step further and provides support for some native gravity forms style declarations for for…
/**
* Borrowed from https://github.com/addyosmani/jquery-ui-bootstrap
* Styles the datepicker popup for gravityforms used with bootstrap
*/
/*
* jQuery UI Datepicker
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
@NoobsArePeople2
NoobsArePeople2 / gist:5121597
Last active November 10, 2023 14:33
Configure media keys on a non-Apple keyboard to control Spotify via AppleScript and USB Overdrive on OSX.

Requirements

  1. USB Overdrive
  2. A non-Apple keyboard with media keys (or keys you want to make "media" keys). For reference, I'm using a Microsoft Sidewinder X4

Set Up

  1. Plug in your keyboard and install USB Overdrive.
  2. Open USB Overdrive. Click into the Settings tab.
  3. Click the dropdown and select "Any Keyboard, Any Application"
@johntyree
johntyree / getBlockLists.sh
Last active March 9, 2024 12:32
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'