Skip to content

Instantly share code, notes, and snippets.

View nvanselow's full-sized avatar

Nick Vanselow nvanselow

  • MA
View GitHub Profile
@nvanselow
nvanselow / StreamToReadableString.java
Created September 13, 2017 03:31
Java convert stream to readable string
StringWriter writer = new StringWriter();
IOUtils.copy(stream, writer, "UTF-8");
String theString = writer.toString();
@nvanselow
nvanselow / ignore_files_in_git.md
Created April 3, 2017 15:47
Ways to stop a local file from being comitted in git

Ignoring the file completely:

git update-index --skip-worktree <file>

git update-index --no-skip-worktree <file>

Assuming the file is unchanged (only recommended for expensive diff checks):

git update-index --assume-unchanged <file>

@nvanselow
nvanselow / missing_profiles.md
Created February 5, 2017 02:44
Fix missing provisioning profiles when running `ionic build ios`

To fix missing provisioning profiles when running ionic build ios run the following command to copy the profiles to the correct directory for ionic. sudo cp -r ~/Library/MobileDevice/ /Library/MobileDevice/

@nvanselow
nvanselow / Android_No_License.md
Created February 5, 2017 01:40
Ionic won't let you build android app because license not accepted

Open android SDK tools at Users/user-name/Library/Android/sdk/tools/android and go through and accept new licenses and download updates.

@nvanselow
nvanselow / fix_empty_homestead.md
Created February 1, 2017 03:29
Fix Empty Vagrant/Homestead Folder

Are the folders in your vagrant/homestead box empty after a forced comptuer restart while the VM was running?

Try: vagrant reload

@nvanselow
nvanselow / database_cleaner.rb
Created July 13, 2016 18:29
Database cleaner config for capybara-webki
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
@nvanselow
nvanselow / .eslintrc.json
Last active December 6, 2021 11:35
Linter for JSX and ES6
{
"env": {
"browser": true,
"node": true
},
"extends": "google",
"installedESLint": true,
"plugins": [
"react"
],
@nvanselow
nvanselow / Transfer_MySql_Database.md
Last active October 1, 2017 13:55
Transferring a MySql database

Warning: Doing the following will overwrite your database.

The following will allow you to use a sql dump to overwrite an existing database.

  1. If the file is gzipped, run gunzip name_of_file.sql.gz
  2. Copy the file to the server
  3. Replace the database with the sql dump. mysql -uusername –p database_name < file.sql
  4. On Laravel Homestead, this would be mysql -uhomestead -p homestead < file.sql

Or this if the above is outputting a bunch of help text:

@nvanselow
nvanselow / Ionic_iOS_Local_Development.md
Created September 29, 2015 00:32
Allow local development servers without http in an iOS Ionic app.

Allowing Local Development Server without HTTPS

New rules cause a Transport Security Error in XCode when trying to test an app using an emulator that connects to a localhost without an SSL certificate. You can add the following code to allow testing on a development server.

Add the following to the platforms/ios/yourappname/YourAppName-Info.plist file

<key>NSAppTransportSecurity</key>
    <dict>
 NSExceptionDomains
@nvanselow
nvanselow / IonicFilePermissions.md
Last active June 16, 2016 14:54
Ionic and Xcode File Permissions and Code Signing Errors

##Ionic, EACCESS, File Permission, and Xcode signing

Recently, Ionic and Xcode 6 have not been playing nicely. I believe I have targeted the error to file permissions that are set when Ionic adds a platform.

I kept getting an Exit Code 1 error when I would try to build my iOS app. Running the following from the terminal from within the project directory solved the error.

sudo chmod -R a+rwx platforms

###Error During iOS App Archiving