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
| #!/bin/bash | |
| # Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/ | |
| # Install stuff # | |
| ################# | |
| # Install development tools and some misc. necessary packages | |
| yum -y groupinstall "Development tools" | |
| yum -y install zlib-devel # gen'l reqs |
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
| /** | |
| * Filter which adds CSRF information as response headers. | |
| * | |
| * @author Patrick Grimard | |
| * @since 12/31/2013 4:48 PM | |
| */ | |
| public final class CsrfTokenGeneratorFilter extends OncePerRequestFilter { | |
| @Override | |
| protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { | |
| CsrfToken token = (CsrfToken) request.getAttribute("_csrf"); |
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
| /** | |
| * CsrfTokenRepository implementation which duplicates HttpSessionCsrfTokenRepository functionality, but also | |
| * adds the generated token to the response as a header when saving the token. | |
| * | |
| * @author Patrick Grimard | |
| * @since 12/31/2013 3:44 PM | |
| */ | |
| public final class HttpHeaderCsrfTokenRepository implements CsrfTokenRepository { | |
| /* other code left out for brevity */ |
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
| /*global webapp, Backbone, JST, _*/ | |
| webapp.Views = webapp.Views || {}; | |
| (function () { | |
| 'use strict'; | |
| webapp.Views.LoginView = Backbone.View.extend({ | |
| template: JST['app/scripts/templates/login.ejs'], |
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 class AppInitializer implements WebApplicationInitializer { | |
| @Override | |
| public void onStartup(javax.servlet.ServletContext servletContext) throws ServletException { | |
| AnnotationConfigWebApplicationContext appContext = new AnnotationConfigWebApplicationContext(); | |
| appContext.register(AppConfig.class); | |
| servletContext.addListener(new ContextLoaderListener(appContext)); | |
| AnnotationConfigWebApplicationContext webConfig = new AnnotationConfigWebApplicationContext(); | |
| webConfig.register(WebConfig.class); | |
| ServletRegistration.Dynamic servlet = servletContext.addServlet("dispatcher", new DispatcherServlet(webConfig)); |
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
| @Configuration | |
| @EnableWebSecurity | |
| public class SecurityConfig extends WebSecurityConfigurerAdapter { | |
| /* other code left out for brevity */ | |
| /** | |
| * Configure HttpSecurity, adds a CsrfTokenGeneratorFilter after CsrfFilter. | |
| * | |
| * @param http |
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
| # xcode-build-bump.sh | |
| # @desc Auto-increment the build number every time the project is run. | |
| # @usage | |
| # 1. Select: your Target in Xcode | |
| # 2. Select: Build Phases Tab | |
| # 3. Select: Add Build Phase -> Add Run Script | |
| # 4. Paste code below in to new "Run Script" section | |
| # 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
| # 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
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.example; | |
| import java.util.concurrent.TimeUnit; | |
| import org.springframework.context.ApplicationContext; | |
| import org.springframework.context.support.ClassPathXmlApplicationContext; | |
| import org.springframework.integration.core.MessageHandler; | |
| import org.springframework.integration.core.PollableChannel; | |
| import org.springframework.integration.core.SubscribableChannel; | |
| import org.springframework.integration.endpoint.PollingConsumer; |
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 sys | |
| import getopt | |
| class Usage(Exception): | |
| def __init__(self, msg): | |
| self.msg = msg | |
| def main(argv=None): | |
| if argv is None: | |
| argv = sys.argv |
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
| #!/bin/sh | |
| # | |
| # nginx - this script starts and stops the nginx daemon | |
| # | |
| # chkconfig: - 85 15 | |
| # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
| # proxy and IMAP/POP3 proxy server | |
| # processname: nginx | |
| # config: /etc/nginx/nginx.conf | |
| # config: /etc/sysconfig/nginx |