Skip to content

Instantly share code, notes, and snippets.

View realityforge's full-sized avatar
🥷

Peter Donald realityforge

🥷
View GitHub Profile
Full thread dump
"qtp1101625662-61" #61 prio=5 os_prio=31 tid=0x00007fcd78195000 nid=0xee0b waiting on condition [0x000070000e1b7000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000796d09ea0> (a java.util.concurrent.FutureTask)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
at java.util.concurrent.FutureTask.get(FutureTask.java:191)
at com.google.gwt.dev.codeserver.JobRunner.getRecompileJs(JobRunner.java:71)

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
@realityforge
realityforge / externalize.rb
Last active February 5, 2019 23:48
Setup a git repository master that points at actual repository
PROJECT_NAME='jsinterop-generator'
PROJECT_SLUG='jsinterop-generator'
UPSTREAM_OWNER='google'
LOCAL_OWNER='realityforge'
LOCAL_BRANCHES_TO_KEEP=%w(TravisCiIntegration)
#WARNING this will delete local branches which may contain your changes
DELETE_LOCAL_BRANCHES=true
def mysystem(command, fail_on_error = true)
@realityforge
realityforge / diff.sh
Created June 27, 2017 03:06
Git diff excluding vendor dir
git diff . ':(exclude)vendor/*'
@realityforge
realityforge / AllLocksInDatabase.sql
Last active April 29, 2021 02:00
SQL Server Performance Queries
SELECT
SessionID = s.Session_id,
resource_type,
DatabaseName = DB_NAME(resource_database_id),
request_mode,
request_type,
login_time,
host_name,
program_name,
client_interface_name,

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@realityforge
realityforge / convert_rails_db_to_domgen.rb
Created September 30, 2013 06:28
Simple bit of code to convert an old rails style schema dump to a domgen architecture.rb
# Output of:
# ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, File.new("Output.rb","wb") )
output_filename = "architecture.rb"
output = File.new(output_filename, "wb")
def pascal_case(camel_cased_word)
word_parts = split_into_words(camel_cased_word).collect { |part| part[0...1].upcase + part[1..-1] }.collect { |v| v.upcase == 'ID' ? 'ID' : v }
return word_parts[0] if (word_parts.size == 1 && word_parts[0] == word_parts[0].upcase)
word_parts.join('')
@realityforge
realityforge / all2dos.sh
Created March 25, 2012 22:56
Convert a repository to Unix EOL
#!/bin/bash
# If fromdos is not present on your system you can try the slower: "perl -pi -e 's/\r\n/\n/;'"
find . \( ! -name '.git' -type f -and -name '*.sql' -or -name '*.textile' -or -name '*.css' -or -name '*.html' -or -name '*.java' -or -name '*.js' -or -name '*.jsp' -or -name '*.properties' -or -name '*.txt' -or -name '*.xml' -or -name '*.xsd' -or -name '*.xsl' -or -name '*.rb' -or -name '*.haml' -or -name '*.rake' -or -name '*.sass' -or -name '*.rhtml' -or -name '*.yml' -or -name '*.yaml' -or -name 'LICENSE' -or -name 'CHANGELOG' -or -name 'Rakefile' -or -name 'rakefile' -or -name 'Buildfile' -or -name 'buildfile' -or -name '*.gemspec' -or -name '.gitignore' -or -name '.gitattributes' \) -exec fromdos {} \;