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.*; | |
import java.util.*; | |
import javax.smartcardio.*; | |
public class CardTest { | |
final protected static char[] hexArray = "0123456789ABCDEF".toCharArray(); | |
public static String bytesToHex(byte[] bytes) { | |
char[] hexChars = new char[bytes.length * 2]; |
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
<?php defined('BASEPATH') or die('Direct access to this file is not permitted.') | |
class MY_Form_validation extends CI_Form_validation | |
{ | |
/** | |
* Postcode Validation Callback | |
*/ | |
public function valid_postcode( $string ) | |
{ |
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
/* app.js | |
* | |
* This code is the client to connect to the Socket.IO server run in the clients browser */ | |
jQuery(document).ready(function(){ | |
/* Connect the socket */ | |
socket = io.connect('http://localhost:8080', { | |
/* Pass the authentication token as a URL parameter */ | |
query: $.param({token: 'i271az2Z0PMjhd6w0rX019g0iS7c2q4R'}) | |
/* My application is more complicated, so I use jQuery's .param utility to convert the Object to an URL string e.g. 'token=abc&etc=cde' */ |
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
// Writing JS for everything is great and all, but I don't want to see JS | |
// inline in my Jade templates. Thankfully, there are ways of abstrating it | |
// into mixins! | |
// Want some Rails-like helpers? | |
mixin link_to(name, href) | |
- href = href || "#" | |
a(href="#{href}")= name | |
// How about a single editing point for a class name? |
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
mixin csrf | |
div | |
input(type='hidden', name='_csrf', value=csrfToken) | |
block | |
mixin formErrors(form) | |
errors = form.nonFieldErrors().errors | |
for error in errors | |
.alert.alert-error= 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
;(function() { | |
'use strict'; | |
angular.module('app').filter('address', Filter); | |
function Filter($sce) { | |
return function(input, seperator, defaultValue) { | |
seperator = seperator || ', '; | |
defaultValue = defaultValue || ''; |
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
/** | |
* Returns the value at the given property. | |
* | |
* @param {object} - the input object | |
* @param {string} - the property accessor expression. | |
* @returns {*} | |
* @alias module:object-get | |
* @example | |
* > objectGet({ animal: 'cow' }, 'animal') | |
* 'cow' |
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 gulp from 'gulp'; | |
import sourcemaps from 'gulp-sourcemaps'; | |
import buffer from 'gulp-buffer'; | |
import uglify from 'gulp-uglify'; | |
import tap from 'gulp-tap'; | |
import browserify from 'browserify'; | |
import babel from 'babelify'; | |
gulp.task('build', () => { |
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
gulp.task('scripts:search', () => { | |
return gulp.src('./search-module/index.js', { read: false }) | |
.pipe(tap((file) => { | |
file.contents = browserify(file.path, { | |
debug: true | |
}).transform(babel, { | |
presets: ["es2015"], | |
plugins: ["angularjs-annotate"] | |
}).bundle(); | |
})) |
OlderNewer