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.willvuong.foodie.controller; | |
import com.willvuong.foodie.dao.PlaceRepository; | |
import com.willvuong.foodie.domain.Place; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.data.repository.CrudRepository; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
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
/* | |
* This function replaces the javascript native alert() function. | |
* I know that by convention it's not a good practice, but if you want to | |
* follow strict stuff, just declare the function with another name and | |
* call it as that. | |
* | |
* jQuery.js is required (http://jquery.com) | |
* | |
* The function can be called like this: | |
* For static (not auto-hide) alert bar: |
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
/** | |
* Simplifies the process of unlocking users. | |
* <p> | |
* The AD attribute "userAccountControl" may be any of the following | |
* - 512 Enabled Account (normally this..) | |
* - 514 Disabled Account | |
* - 544 Enabled, Password Not Required | |
* - 546 Disabled, Password Not Required | |
* - 66048 Enabled, Password Doesn't Expire | |
* - 66050 Disabled, Password Doesn't Expire |
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 org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration; | |
import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; | |
import org.springframework.context.annotation.Configuration; | |
import java.io.IOException; | |
import java.net.ServerSocket; | |
@Configuration |
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 { Pipe, PipeTransform } from '@angular/core'; | |
/* | |
* Convert bytes into largest possible unit. | |
* Takes an precision argument that defaults to 2. | |
* Usage: | |
* bytes | fileSize:precision | |
* Example: | |
* {{ 1024 | fileSize}} | |
* formats to: 1 KB |
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
/** | |
* Created by kientux on 3/20/15 | |
*/ | |
import android.util.Base64; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
import java.util.Arrays; |
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
/** | |
* Creates a "logging" schema with an "history" table where are stored records in JSON format | |
* | |
* Requires PostgreSQL >= 9.3 since data is stored in JSON format | |
* | |
* Credits: http://www.cybertec.at/2013/12/tracking-changes-in-postgresql/ | |
*/ | |
/* Create a schema dedicated to logs */ | |
CREATE SCHEMA logging; |
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
/** | |
* Code written by P. Gajland | |
* https://github.com/GaPhil | |
*/ | |
import java.security.Key; | |
import javax.crypto.Cipher; | |
import sun.misc.BASE64Encoder; | |
import sun.misc.BASE64Decoder; | |
import javax.crypto.spec.SecretKeySpec; |