Skip to content

Instantly share code, notes, and snippets.

@cotyembry
cotyembry / raspberrypiLinuxBackgroundProcess.md
Created August 21, 2017 00:26
Keep process running in background after disconnecting from ssh terminal session & &&
@cotyembry
cotyembry / convertURLImageToBLOBThenEmailItInline.gs
Created May 24, 2017 05:49
This is a .gs (google script) file that will fetch an image from a url using I suppose some of the Google Services APIs, converts that object to a BLOB, then sends the image to the email specified with the images inline within the email (This is so freaking cool - I tested it myself ^_^)
// This code fetches the Google and YouTube logos, inlines them in an email
// and sends the email
function inlineImage() {
// var googleLogoUrl = "http://www.google.com/intl/en_com/images/srpr/logo3w.png";
var youtubeLogoUrl =
"https://developers.google.com/youtube/images/YouTube_logo_standard_white.png";
//var googleLogoBlob = UrlFetchApp
// .fetch(googleLogoUrl)
// .getBlob()
// .setName("googleLogoBlob");
@cotyembry
cotyembry / githubCommitTimeBookmarklet.js
Created May 22, 2017 05:10
This is a bookmarklet that you can use in a web browser - when you execute it, its intended use is on github.com when you are viewing a commit - it will create an element and add the time it was committed at the very top top of the webpage (it uses document.body.prepend(...) to do that)
javascript:(function() { var el = document.createElement('div'); document.body.prepend(el); el.innerHTML = document.getElementsByTagName('relative-time')[0].getAttribute('title');}() )
@cotyembry
cotyembry / viewFileVersionsXCodeCLI.md
Created April 30, 2017 00:20
Use this command to check the plist files and the versions of your targets and returns their version numbers
agvtool what-marketing-version
@cotyembry
cotyembry / createAppIconsiOS.md
Created April 14, 2017 22:46
A short and sweet example on how to create and link app icons for all iPhone screen sizes with pretty close to one command line call

First up,

Make sure to have everything installed that is needed

npm install -g yo generator-rn-toolbox

To generate your icons, the generator uses ImageMagick. On macOS, you can install it with:

brew install imagemagick

Have a single icon file at the ready somewhere. 200x200px is sufficient.

@cotyembry
cotyembry / DefaultKeyBinding.dict
Created April 1, 2017 16:25 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
  1. install x-button mouse control
  2. set middle click (or any button you desire) to actually do a left button click
  3. go to the microsoft mouse and keyboard application
  4. set your desired gesture to trigger a middle click - or your custom action if you specified one in step 2. (x-button mouse control will override and do a normal click)

issues: -you lose a button since you are overriding one -tap and hold still doesn't work (i.e. drag and drop is still not functional)

@cotyembry
cotyembry / reactNativeGistSetup.md
Created March 19, 2017 08:22
My super quick overview of the steps I did tonight to get a fresh, up to date, react-native project setup
  1. create-react-native-app projectName
  2. pod init in the ios folder 2.1. add any pod files you want to ios/Podfile 2.2. pod install 2.2.1 sometimes this git repo doesnt download...you can google and find the .zip file for it and just take the .git file that is created and use it any synthetically create this stupid workaround... 2.2.2 pod install --no-update (or some modifier like that - sorry, this isnt exact...youre honestly lucky im taking the small amount of time to write what I'm writing)
  3. react-native link (something like that) to link the pod files
  4. create a workspace in xcode (if you need to write native code)
  5. drag the .xcodeproject (or whatever its called) to the newly created .wrkspace project
  6. from now on only use the .wrkspace project (this is because of the pod files have to be structured in the project directory as they are - you can read about it)
@cotyembry
cotyembry / windowsCMDAliases.md
Created March 17, 2017 18:06
Windows Shortcut Cusomizer - This is how you can pass in a program and an argument for a shortcut on windows

C:\Windows\System32\cmd.exe /K C:\Users\johnembry\Developer\aliases\aliases.bat

@cotyembry
cotyembry / uniqueKeyNChildReact.md
Created March 8, 2017 01:56
This shows an awesome way to manage unique keys with references uniquely identified
	this.Sections = [];
	//by using block scope introduced by let, I am able to pass a unique value to each different child, in order to uniquely identify them without any other dependencies
	for(let i = 1; i <= 4; i++) {
		this.Sections.push(
			<div style={styles.section} key={'parent_' + i} className='section'>
				<div style={styles.header} key={i} onClick={() => this._onClick(i)} className='header'></div>
			</div>
		)

}