Skip to content

Instantly share code, notes, and snippets.

View mtt87's full-sized avatar
🍔

Mattia mtt87

🍔
View GitHub Profile
@mtt87
mtt87 / prismic-angular
Last active August 29, 2015 14:11
Prismic.io + Angular the right way, advice needed
// DRY????? :( How can I avoid to repeat $window.Prismic.Api('...', callback) ??
app.factory('Prismic', function($window, $q) {
return {
blogList: function(page) {
var blogList = $q.defer();
$window.Prismic.Api('https://thtest.prismic.io/api', function(err, Api) {
Api.form('everything')
.ref(Api.master())
.query(Prismic.Predicates.at('document.type', 'article')).pageSize(3).page(page).submit(function(err, response) {
@mtt87
mtt87 / error.txt
Created February 1, 2015 10:41
Trying to add some npm modules to a Meteor project
npm-container: updating npm dependencies -- ytdl-core, youtube-api...
npm ERR! Error: Problems were encountered
npm ERR! Please correct and try again.
npm ERR! missing: tap-consumer@*, required by tap@0.3.3
npm ERR! at shrinkwrap_
(/Users/mattia/.meteor/packages/meteor-tool/.1.0.40.959pzb++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/npm/lib/shrinkwrap.js:30:15)
npm ERR! at
/Users/mattia/.meteor/packages/meteor-tool/.1.0.40.959pzb++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/npm/lib/shrinkwrap.js:24:5
npm ERR! at
/Users/mattia/.meteor/packages/meteor-tool/.1.0.40.959pzb++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/npm/lib/ls.js:45:30
# Node Express Staging on Port 3000
upstream staging{
server 127.0.0.1:3000;
}
# NGINX Server Instance
server {
listen 0.0.0.0:80;
server_name staging.example.com;
var client = contentful.createClient({space: ‘a2b2c3d4e5’, accessToken: ‘not_a_secret’});
// retrieve the data with content_type = job
client.getEntries({'content_type': 'job'})
.then(function (entries) {
// do stuff
});
<spinner>
<div class=”has-text-centered”>
<span class=”fa fa-cog fa-spin spinner”></span>
</div>
<script>
this.on(‘data-loaded’, function(){
this.unmount();
});
</script>
</spinner>
gulp.task('riot', ()=> {
gulp.src('app/tags/*.tag')
.pipe($.riot())
.pipe(gulp.dest('.tmp/scripts'));
});
gulp.task('serve', ['styles', 'scripts', 'riot', 'fonts'], () => {
browserSync({
routes: {
'/node_modules/': 'node_modules'
}
}
});
// Override Bulma Variables
$family-sans-serif: “Roboto”, “Helvetica”, “Arial”, sans-serif;
$techhub: #f9b233;
...
@import “../../node_modules/bulma/sass/utilities/utilities”;
@import “../../node_modules/bulma/sass/base/base”;
@import “../../node_modules/bulma/sass/elements/box”;
@import “../../node_modules/bulma/sass/elements/button”;
@import “../../node_modules/bulma/sass/elements/title”;
@import “../../node_modules/bulma/sass/elements/other”;
gulp.task('publish', function() {
return gulp.src('dist/**/*.*')
.pipe(revAll.revision())
.pipe($.awspublish.gzip())
.pipe(publisher.publish(headers))
.pipe(publisher.cache())
.pipe($.awspublish.reporter())
.pipe($.cloudfront(awsConfig));
});

Keybase proof

I hereby claim:

  • I am mtt87 on github.
  • I am mtt (https://keybase.io/mtt) on keybase.
  • I have a public key whose fingerprint is 335E 77F6 B689 C7B2 51EB 6621 161B 5802 17C8 8908

To claim this, I am signing this object: