Skip to content

Instantly share code, notes, and snippets.

View dawogfather's full-sized avatar

Tom Romano dawogfather

View GitHub Profile
@rdmueller
rdmueller / map2Json.groovy
Last active March 1, 2020 21:35
This Gist demonstrate how to serialize a Map to JSON and YAML with Groovy
//Problem:
//languages like tcl can simply switch between the String representation of a map or list and the
//object itself. In Groovy, this could theoretically work, but it doesn't:
def list1 = [1,2,3]
def list2 = ["1, 2, 3"]
assert list1 != list2
assert list1.toString() == list2.toString()
assert Eval.me(list1.toString()) instanceof List
assert Eval.me(list2.toString()) instanceof List
assert Eval.me(list1.toString()) == Eval.me(list2.toString())
@alirobe
alirobe / reclaimWindows10.ps1
Last active March 28, 2024 12:31
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active March 8, 2024 13:18
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active March 26, 2024 08:15
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@mateuszgachowski-snippets
mateuszgachowski-snippets / itunes.sh
Created December 6, 2013 22:19
Bash: iTunes CLI
#!/bin/sh
#
####################################
# iTunes Command Line Control v1.0
# written by David Schlosnagle
# created 2001.11.08
# @edited Mateusz Gachowski
####################################
showHelp () {
@hofmannsven
hofmannsven / README.md
Last active March 22, 2024 19:45
Git CLI Cheatsheet
@supermarin
supermarin / dash_emoji_snippets.sql
Last active January 30, 2020 19:58
Emoji in realtime with Dash.app Thanks @orta for putting this up. Read below for importing instructions
INSERT INTO 'snippets' ('title', 'body') VALUES
(':+1:', '👍'),
(':-1:', '👎'),
(':100:', '💯'),
(':1234:', '🔢'),
(':8ball:', '🎱'),
(':a:', '🅰'),
(':ab:', '🆎'),
(':abc:', '🔤'),
(':abcd:', '🔡'),
@ddeyoung
ddeyoung / gist:5502723
Last active July 21, 2017 16:27
Enable comment toggling in Sublime Text 2 for Groovy on OS X
Copy the Java comment config file to the Groovy directory
cp ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Java/Comments.tmPreferences ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Groovy/
Edit ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Groovy/Comments.tmPreferences
Change line 8
<string>source.java</string>
@djangofan
djangofan / endorsedmethod.java
Last active January 6, 2023 22:05
Exercise on safely waiting for unstable web elements with WebDriver.
// This is the official Selenium documention endorsed method of waiting for elements.
// This method is ineffective because it still suffers from
// the stale element exception.
public static void clickByLocator ( final By locator ) {
WebElement myDynamicElement = ( new WebDriverWait(driver, 10))
.until( ExpectedConditions.presenceOfElementLocated( locator ) );
myDynamicElement.click();
}
@benvium
benvium / FadeSplash.m
Created September 28, 2012 09:05
iOS: Fade from the splash screen to your initial view. Works on iPhone 5 (and 4,3). Add a UIImageView property called splashView.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//.. do other setup
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
// Transition neatly from splash screen
// Very odd, on iPhone 5 you need to position the splash screen differently..