Skip to content

Instantly share code, notes, and snippets.

Mark Hendrickson markmhx

View GitHub Profile
View gist:8698679
Parse.Cloud.define('findStory', function(request, response) {
Parse.Cloud.useMasterKey();
var storyQuery = new Parse.Query('Story');
storyQuery.include('keptPhotos');
storyQuery.get(request.params.objectId).then(
function(story) {
response.success(story);
},
@markmhx
markmhx / gist:7722350
Last active Dec 29, 2015
Code illustrating issue where SourcesRoute fetches an undefined ApplicationController.model value even when the ApplicationRoute's model method has properly set the model value before SourcesRoute's beforeModel method is triggered, as expected with promises. While ApplicationController.model's value has been set, it's as if its value doesn't get…
View gist:7722350
App.ApplicationRoute = Ember.Route.extend({
model: function() {
return this.store.find('user').then(function(users) {
return users.get('firstObject');
});
}
}
App.SourcesRoute = Ember.Route.extend({
beforeModel: function() {
@markmhx
markmhx / gist:7749416
Last active Dec 30, 2015
I'm finding further inconsistent behavior when trying to access the model of the Application controller. In the example below, if the IndexRoute is first loaded without any user fixtures, the Application model is undefined as expected. After triggering the authenticateUser method on the IndexRoute, a new user object should be set as the Applicat…
View gist:7749416
App.ApplicationRoute = Ember.Route.extend({
model: function() {
return this.store.find('user').then(function(users) {
return users.get('firstObject');
});
}
});
App.ApplicationController = Ember.Controller.extend({
authenticateUser: function() {
View rake-cache-clear.bash
wasp $ rake cache:clear
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(called from <top (required)> at /Users/markhendrickson/.rvm/gems/ruby-2.3.1@wasp/gems/skim-0.10.0/lib/skim/sprockets.rb:3)
rake aborted!
Don't know how to build task 'cache:clear' (see --tasks)
/Users/markhendrickson/.rvm/gems/ruby-2.3.1@wasp/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/Users/markhendrickson/.rvm/gems/ruby-2.3.1@wasp/bin/ruby_executable_hooks:15:in `eval'
@markmhx
markmhx / foursquare-checkin.json
Last active Nov 13, 2017
Example of check-in pulled from the Foursquare API
View foursquare-checkin.json
{
"meta": {
"code": 200,
"requestId": "5a09bb0a4434b9509cf028a7"
},
"notifications": [
{
"type": "notificationTray",
"item": {
"unreadCount": 0
@markmhx
markmhx / stylebee-pro-help-center-embed-template.html
Last active Nov 26, 2017
STYLEBEE pro help center video embed template
View stylebee-pro-help-center-embed-template.html
<div class="video">
<div>
<iframe src="https://www.youtube.com/embed/S7RNb7KCUgU?rel=0&amp;modestbranding=1&amp;autoplay=1&amp;showinfo=0&amp;fs=1&amp;color=white" frameborder="0" allowfullscreen="allowfullscreen"></iframe
</div>
</div>
View gist:ae29843bec1181e9711f2167890d50cf
Verifying my Blockstack ID is secured with the address 1789gBX7w1XFPeG5SFKkbfsUbrHvnTvYRC https://explorer.blockstack.org/address/1789gBX7w1XFPeG5SFKkbfsUbrHvnTvYRC
@markmhx
markmhx / gist:27ddec1b80c9c60ffb473e1e7cb5fe19
Created Jan 29, 2019
Task 7: Set up an Nginx reverse proxy –  sudo apt-get install nginx
View gist:27ddec1b80c9c60ffb473e1e7cb5fe19
root@markmhendrickson-hub:~/gaia/hub# sudo apt-get install nginx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0
libjpeg-turbo8 libjpeg8 libnginx-mod-http-geoip
libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter
libnginx-mod-mail libnginx-mod-stream libtiff5 libwebp6 libxpm4
nginx-common nginx-core
View gist:098132dc82ee2927a86e111d1fcd92b8
document.addEventListener("DOMContentLoaded", function(event) {
const authRequest = blockstack.makeAuthRequest(
blockstack.generateAndStoreTransitKey(),
'http://localhost:5000/',
'http://localhost:5000/manifest.json',
['store_write', 'publish_data'],
'http://localhost:5000/',
blockstack.nextHour().getTime(), {
solicitGaiaHubUrl: true
} // new options param
View gist:fb97fadc08425e31aed8eb1ee39ade29
document.addEventListener("DOMContentLoaded", function(event) {
document.getElementById('signin-button').addEventListener('click', function(event) {
event.preventDefault()
const authRequest = blockstack.makeAuthRequest(
blockstack.generateAndStoreTransitKey(),
'http://localhost:5000/',
'http://localhost:5000/manifest.json',
['store_write', 'publish_data'],
'http://localhost:5000/',
You can’t perform that action at this time.