$ docker
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
// borrowed from https://getbootstrap.com/docs/4.4/getting-started/browsers-devices/ | |
<script> | |
$(function () { | |
var nua = navigator.userAgent | |
var isAndroid = (nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1 && nua.indexOf('Chrome') === -1) | |
if (isAndroid) { | |
// do stuff | |
} | |
}) | |
</script> |
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
module BrowserClassHelper | |
def browser_class | |
if ie11? | |
"is-ie11" | |
else | |
"is-" + request.browser.downcase | |
end | |
end | |
def ie11? |
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
<div class="container"> | |
<h3 class="page-header">Upload Photos Page</h3> | |
<form class="form-horizontal"> | |
<div class="form-group"> | |
<label for="photo" class="col-sm-2 control-label">Upload</label> | |
<div class="col-sm-10"> | |
<input type="file" class="form-control" name="photo" id="photo" accept=".png, .jpg, .jpeg" onchange="readFile(this);" multiple> | |
</div> | |
</div> |
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
var OFF = 0, WARN = 1, ERROR = 2; | |
module.exports = exports = { | |
"env": { | |
"es6": true | |
}, | |
"ecmaFeatures": { | |
// env=es6 doesn't include modules, which we are using | |
"modules": true |
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
# Ruby wrapper for UglifyJS JavaScript compressor | |
gem "uglifier", ">= 1.3.0" | |
#Search Engine Optimization (SEO) | |
gem "meta-tags" | |
# Sucker Punch is a Ruby asynchronous processing library using concurrent-ruby, heavily influenced by Sidekiq and girl_friday. | |
gem "sucker_punch" |
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 { createStore, combineReducers} from "redux"; | |
import uuid from 'uuid/v1'; | |
// NOTE: | |
// to create store we need to pass reducer in createStore() method | |
// reducer is a function with state and action params - testReducer(state = demostate, action) | |
// reducer will return result based on action.type | |
// we need to pass demoState in params | |
// state of the application would look like this demoState |
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
console.log('Before'); | |
// callback approach | |
// getUser(1, displayUser); | |
// promised based approach | |
// getUser(1) | |
// .then(user => getRepositories(user.name)) | |
// .then(repos => getCommits(repos[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
const p = new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve(1); | |
// reject(new Error('message')); | |
}, 2000) | |
}); |
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
console.log('Before'); | |
getUser(1, displayUser); | |
console.log("After"); | |
function getUser(id, callback){ | |
setTimeout(() => { | |
console.log("Reading a user from database!"); | |
callback({ id: id, name: "salmanx" }) |