This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form = Backbone.Form | |
Backbone.Form = class extends Form | |
commit: (options) -> | |
validationResults = @validate() | |
errors = _.filter validationResults, (result) -> result.level is "error" | |
return errors if errors and errors.length > 0 | |
modelError = undefined | |
setOptions = _.extend { | |
error: (model, e) -> modelError = e if e.level is "error" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsersRouter extends ResourceRouter | |
path: "users" | |
layout: "#contents" | |
routes: | |
":id": "show" | |
show: (id) -> | |
new User({id: id}).fetch success: (model) => | |
@layoutView ShowView, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class AESProtector { | |
private static final Configuration CONFIGURATION; | |
static { | |
try { | |
CONFIGURATION = ConfigurationLoader.load(Configuration.class, "aes-security-policy.yml", "default-aes-security-policy.yml"); | |
} catch (IOException e) { | |
throw new RuntimeException(e); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: Meiryo; | |
} | |
.LW-avf { | |
font-family: Meiryo !important; | |
} | |
.F { | |
font-family: Meiryo !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/css_splitter.rb | |
class CssSplitter | |
CHARSET = '@charset "UTF-8"' | |
def initialize(infile, outdir = File.dirname(infile)) | |
@infile = infile | |
@outdir = outdir | |
@filenames = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.usopla.gist; | |
import static com.google.common.base.Preconditions.checkNotNull; | |
import java.io.IOException; | |
import java.net.URL; | |
import javax.annotation.Nullable; | |
import com.fasterxml.jackson.core.JsonParseException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sandbox; | |
import java.io.IOException; | |
import java.util.LinkedList; | |
import java.util.List; | |
import com.github.jknack.handlebars.Handlebars; | |
import com.github.jknack.handlebars.Template; | |
import com.github.jknack.handlebars.io.ClassPathTemplateLoader; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import javax.ws.rs.client.Client; | |
import javax.ws.rs.client.ClientBuilder; | |
import javax.ws.rs.core.MediaType; | |
import org.glassfish.jersey.filter.LoggingFilter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.usopla.gist; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.Reader; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.security.AccessController; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveSupport.on_load(:active_record) do | |
module ActiveRecord | |
class Base | |
class << self | |
def audit_with_destroy(*args) | |
audit_without_destroy(*args) | |
after_destroy { |record| record.snap!(:action => "destroy") } | |
end | |
alias_method_chain :audit, :destroy | |
end |