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
getJobs: function(req, res){ | |
var params = req.params.all(), | |
date = Date.now(); | |
if(!params.sort){ | |
params.sort = 'DESC'; | |
} | |
if(!params.attr){ |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
main: function(){ | |
return this.store.find('post'); | |
}.property(), |
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 nilla(element){ | |
element.hasClass = function(classname){ | |
if(this.className.match(new RegExp('(\\s|^)'+classname+'(\\s|$)'))){ | |
return true; | |
} else { | |
return false; | |
} |
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 upload(){ | |
Blocks.upload(this, function(err, res){ | |
console.log(res); | |
}); | |
} | |
document.getElementById('btn').addEventListener('click', Blocks.stop, false); | |
document.getElementById('btn').addEventListener('click', upload, false); |
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 Blocks = new Object(); | |
function loadScript(url, callback){ | |
var script = document.createElement("script") | |
script.type = "text/javascript"; | |
if (script.readyState){ //IE | |
script.onreadystatechange = function(){ | |
if (script.readyState == "loaded" || |
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.exports = { | |
new: function(req, res){ | |
var params = req.params.all(); | |
console.log(params); | |
req.file('file').upload({ | |
// ...any other options here... | |
adapter: require('skipper-s3'), |
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 gulp = require('gulp'); | |
var jsforce = require('jsforce'); | |
var async = require('async'); | |
gulp.task('force', function(){ | |
var conn = new jsforce.Connection(); | |
conn.login('<Salesforce Login Email>', '<Salesforce Password + Security Token>', function(err, userInfo) { | |
if (err) console.error(err); |
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
<form action="http://localhost:1337/charge/EJPtU76" method="POST"> | |
<script | |
src="https://checkout.stripe.com/checkout.js" | |
class="stripe-button" | |
data-key="pk_test_bSb7tIiZYGyKMZVwsuD8S9AN" | |
data-image="" | |
data-name="No Reciept Again" | |
data-description="" | |
data-amount=""> | |
</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
fs.stat('log.txt', function(err, stat) { | |
if(err == null) { | |
console.log('File exists'); | |
} else if(err.code == 'ENOENT') { | |
fs.writeFile('log.txt', 'Some log | |
'); | |
} else { | |
console.log('Some other error: ', err.code); | |
} | |
}); |