Skip to content

Instantly share code, notes, and snippets.

View Rokt33r's full-sized avatar
🧨
BOOM!

Junyoung Choi Rokt33r

🧨
BOOM!
View GitHub Profile
@Rokt33r
Rokt33r / validation-form.html
Created May 31, 2015 18:08
Angular Form Validation
<form id="addForm" name="addForm" novalidate>
<label>Category:</label>
<select ng-model="expense.category" ng-options="category for category in categories"></select>
<label>Amount:</label>
<input required type="number" ng-model="expense.amount"></input>
<label>Description:</label>
<input type="text" ng-pattern="/^[a-zA-Z 0-9]*$/" ng-model="expense.description"></input>
<button ng-disabled="addForm.$pristine || addForm.$dirty && addForm.$invalid" ng-click="submit()">Submit</button>
</form>
@Rokt33r
Rokt33r / app-capable.html
Created May 31, 2015 16:32
App capable meta tag
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
@Rokt33r
Rokt33r / link.html
Last active August 29, 2015 14:22
ipad icon link tag
@Rokt33r
Rokt33r / promise-chain.js
Created May 29, 2015 03:15
Promise Chain
var makePromise = function (str) {
console.log(str)
return new Promise(function(resolve, reject){
setTimeout(function(){resolve(str+1)}, 1000)
})
}
makePromise(1).then(makePromise).then(makePromise).then(makePromise)
@Rokt33r
Rokt33r / props-filter.js
Created May 27, 2015 17:31
Angular propsFilter
app.filter('propsFilter', function() {
return function(items, props) {
var out = [];
if (angular.isArray(items)) {
items.forEach(function(item) {
var itemMatches = false;
var keys = Object.keys(props);
for (var i = 0; i < keys.length; i++) {
@Rokt33r
Rokt33r / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Rokt33r
Rokt33r / index.html
Last active August 29, 2015 14:21
JWT-AUTH Example html
<!doctype html>
<html ng-app="jwt-auth">
<head>
<meta charset="UTF-8">
<title>JWT-AUTH</title>
</head>
<body>
<div ng-controller="AppController as vm">
<button ng-click="vm.getResource()">Get protected resource</button>
<div ng-if="!vm.isLoaded">
@Rokt33r
Rokt33r / Transaction.md
Last active August 29, 2015 14:21
Transaction
@Rokt33r
Rokt33r / file0.php
Created May 7, 2015 07:39
Laravel Test: `call` method wrapper for Angular $http ref: http://qiita.com/fluke8259/items/224dac74f62c921c9efd
<?php
use Illuminate\Http\Request;
class TestCase extends Illuminate\Foundation\Testing\TestCase {
use TestHelpersTrait;
/**
* Creates the application.
*
@Rokt33r
Rokt33r / .md
Last active August 29, 2015 14:20
REST Test helper for Laravel5

Test Helper

Simple test helper trait for testing Laravel5 REST API app.

Using packages

  • Laracasts/TestDummy for Intergration test with DB
  • Flow/JSONPath for validating JSON

How to use

Install the packages