Skip to content

Instantly share code, notes, and snippets.

View gist:8788506
{
"exam" : {
"exam_id" : 1,
"student_id" : "87sn8s9d-ns97-8dbf-987s-334b98ds8"
"exam_words" : [
{
"word_id" : 24,
"score" : false
},
{
@lsmolic
lsmolic / RestartNotSupportedException
Created Feb 12, 2014
RestartNotSupportedException
View RestartNotSupportedException
javax.servlet.ServletException: hudson.lifecycle.RestartNotSupportedException: Failed to obtain the command line arguments of the process
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:735)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:799)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:587)
at org.kohsuke.stapler.Stapler.service(Stapler.java:218)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
at winstone.ServletConfiguration.execute(ServletConfiguration.java:248)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
View gist:9697954
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_student_rewards_on_student_id_and_reward_type"
DETAIL: Key (student_id, reward_type)=(2, silver) already exists.
: INSERT INTO "student_rewards" ("created_at", "reward_type", "student_exam_id", "student_id", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"
/Users/lsmolic/Repos/concept_yard/lantern-portal/app/models/concerns/exam_utility.rb:85:in `set_reward'
/Users/lsmolic/Repos/concept_yard/lantern-portal/app/models/concerns/exam_utility.rb:74:in `reward!'
/Users/lsmolic/Repos/concept_yard/lantern-portal/lib/tasks/fake_seed.rake:99:in `block in create_student_exams'
/Users/lsmolic/Repos/concept_yard/lantern-portal/lib/tasks/fake_seed.rake:77:in `times'
/Users/lsmolic/Repos/concept_yard/lantern-portal/lib/tasks/fake_seed.rake:77:in `each'
/Users/lsmolic/Repos/concept_yard/lantern-portal/lib/tasks/fake_seed.rake:77:in `create_student_exams'
@lsmolic
lsmolic / gist:2628430
Created May 7, 2012
Git Branch in console prompt
View gist:2628430
function parse_git_branch
{
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
function proml
{
PS1="[\w\$(parse_git_branch)]$"
}
proml
View gist:5088844
#!/usr/bin/env bash
ruby_string="ruby-1.8.7-p357"
#ruby_string="ruby-1.9.3-p194"
gemset_name="cke2"
if rvm list strings | grep -q "${ruby_string}" ; then
# Load or create the specified environment
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
View gist:5690893
class YourBody {
boolean is_moving = false;
String[] known_actions = { “Forward”, “Backward”, “Left”, “Right” };
boolean validRequest( String this_action ){
for ( int i = 0; i < known_actions.length; i++)
{
if ( known_actions[i] == this_action )
{
return true;
View gist:5690897
class YourBody {
boolean is_moving = false;
String[] known_actions = { "Forward", "Backward", "Left", "Right" };
boolean validRequest( String this_action ){
for ( int i = 0; i < known_actions.length; i++)
{
if ( known_actions[i] == this_action )
{
return true;
View gist:5969665
#CONFIG TERMINAL
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
#sets up the prompt color (currently a green similar to linux terminal)
#enables color for iTerm
export TERM=xterm-color
export EC2_HOME=/Users/lsmolic/.ec2
export EC2_PRIVATE_KEY=`ls $EC2_HOME/pk-*.pem`
export EC2_CERT=`ls $EC2_HOME/cert-*.pem`
#export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home
@lsmolic
lsmolic / gist:6084955
Created Jul 26, 2013
changes to asset auto_deploy
View gist:6084955
desc <<-DESC
Deploy the system directory to production
DESC
task :fs, :roles => :web, :once => true do
servers = find_servers_for_task(current_task)
puts "SERVERSSSSSSS......>>>>>>>> #{servers}"
servers.each do |server|
port = 22
Array(fetch(:sync_directories, [])).each do |syncdir|
destination, base = Pathname.new(syncdir).split
View gist:7489199
awsmsce:Hey everyone, quick question (hopefully) regarding URIs. wondering where there is a different uri for the same card when you refer to it from active_card and what the tokenizer returns
[2:48pm]jacobolus:hi awsmsce
[2:48pm]jacobolus:awsmsce: can you elaborate a bit?
[2:49pm]jacobolus:what's the "tokenizer"?
[2:49pm]awsmsce:when you tokenize a code, the api returns a URI for a card.. without a customer associated:
[2:49pm]jacobolus:yes
[2:50pm]awsmsce:however this differs from the URI that is returned when looking up a customer's active card
[2:50pm]awsmsce:but shouldn't the URI always be the same?
[2:50pm]awsmsce:the ID doesn't change
[2:50pm]jacobolus:if you tokenize a new card, then that card's URI is going to differ from a customer's existing card...?