Skip to content

Instantly share code, notes, and snippets.

View VineetReynolds's full-sized avatar
🚀

Vineet Reynolds VineetReynolds

🚀
View GitHub Profile
@VineetReynolds
VineetReynolds / disable.sh
Created October 1, 2017 01:36
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
failed to compile tested package feature:
WORK=/var/folders/b0/3v0rtks95fq_8p681jy91q540000gn/T/go-build081828163
# github.com/golang
./nonauthorized_test.go:75: cannot use "github.com/goadesign/goa/client".HTTPClientDoer(http.DefaultClient) (type "github.com/goadesign/goa/client".Doer) as type "github.com/almighty/almighty-core/vendor/github.com/goadesign/goa/client".Doer in argument to "github.com/almighty/almighty-core/client".New:
"github.com/goadesign/goa/client".Doer does not implement "github.com/almighty/almighty-core/vendor/github.com/goadesign/goa/client".Doer (wrong type for Do method)
have Do("golang.org/x/net/context".Context, *http.Request) (*http.Response, error)
want Do("github.com/almighty/almighty-core/vendor/golang.org/x/net/context".Context, *http.Request) (*http.Response, error)
./nonauthorized_test.go:170: cannot use "github.com/goadesign/goa/client".HTTPClientDoer(http.DefaultClient) (type "github.com/goadesign/goa/client".Doer) as type "github.com/almighty/almighty-core/vendor/git

Start Docker Machine

  • docker-machine start default

Start Kubernetes on Docker machine VM

  • kid up

Install Jenkins and Docker registry on kubernetes using Helm

@VineetReynolds
VineetReynolds / Textmate-Instructions.md
Last active April 27, 2016 01:58
Installing Asciidoc bundle in Textmate 2
package org.jboss.examples.bankplus.customer.services.translators;
public class AccountTranslator {
public org.jboss.examples.bankplus.customer.model.Account
translate(org.jboss.examples.bankplus.customer.services.adapters.Account container) {
org.jboss.examples.bankplus.customer.model.Account account = null;
if(container != null) {
account = new org.jboss.examples.bankplus.customer.model.Account();
account.setAccountReference(container.getAccountId());
@Stateless
public class Accounts {
@PersistenceContext
private EntityManager em;
...
public Account getLiabilitiesAccount() {
TypedQuery<Account> findByNameQuery = em.createQuery("SELECT DISTINCT a FROM Account a "
+ "WHERE UPPER(a.name) = 'LIABILITIES'", Account.class);
Account liabiltiesAccount = findByNameQuery.getSingleResult();
# Based on http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
# with some amendments
# create a new branch in WFK quickstarts
git checkout -b kitchensink-html5-mobile
# For kitchensink-html5-mobile, in wfk-quickstarts
# the following command filters out only the kitchensink-html5-mobile dir, and retains it's contents in the root dir
git filter-branch -f --subdirectory-filter kitchensink-html5-mobile -- --all
vreynolds@RH0003210 www.jboss.org$ rake clean preview
Using profile: development
Generating site: http://localhost:4242
While processing file
An error occurred: uninitialized constant ActiveSupport::Autoload
/home/vreynolds/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.6/lib/active_support/number_helper.rb:3:in `<module:NumberHelper>'
/home/vreynolds/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.6/lib/active_support/number_helper.rb:2:in `<module:ActiveSupport>'
/home/vreynolds/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.6/lib/active_support/number_helper.rb:1:in `<top (required)>'
/home/vreynolds/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.6/lib/active_support/core_ext/numeric/conversions.rb:2:in `require'
/home/vreynolds/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.6/lib/active_support/core_ext/numeric/conversions.rb:2:in `<top (required)>'
@VineetReynolds
VineetReynolds / Scaffolding drawbacks.md
Last active August 29, 2015 14:06
Reasons to not scaffold from a database
  • Lack of awareness of transactional context. Say you have entities A, B and C where only A and B are related to each other in the database schema. If your use case requires updates to all three entities, scaffolding will not generate code to update them. At best, the generated code will update A and B. Knowledge about C is simply not there in the database; it exists in the use-case.
  • Scaffolding for entities with composite keys can get complicated. In an ideal world, REST resources mapped to a database entity, are mapped using the primary key. Composite keys ensure complicated URLs. Matrix parameters are a solution, but some JS client frameworks do not even support this (remember, matrix parameters are just a design note, and not part of the HTTP 1.0 and 1.1 RFCs).
!ENTRY org.eclipse.jface 4 0 2014-09-12 20:46:18.859
!MESSAGE Unhandled event loop exception during blocked modal context.
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IndexOutOfBoundsException: Index: 3, Size: 3)
at org.eclipse.swt.SWT.error(SWT.java:4441)
at org.eclipse.swt.SWT.error(SWT.java:4356)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:139)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:175)