Skip to content

Instantly share code, notes, and snippets.

View TimonVS's full-sized avatar

Timon van Spronsen TimonVS

View GitHub Profile
@TimonVS
TimonVS / index.html
Last active June 11, 2017 13:43
Electron workshop - step 1
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<div id="app"></div>
</body>

Button

API

Property Description Type Default
type Can be set to default, ghost, link string default
theme Can be set to primary, secondary, error string primary
size Size of the button. Can be set to xs, sm, md, mdw, lg, xl string md
href When provided the component will render as an <a> instead of `` string ''
@TimonVS
TimonVS / Loader.md
Last active February 15, 2017 12:23

Loader

Shows a loading indicator.

API

Property Description Type Default
type Can be set to ellipsis or spinner string spinner
const R = require('ramda')
const fetch = require('node-fetch')
const fetchJson = (f) => f.then(res => res.json())
const prepareGithubRequest = R.curry((accessToken, path) => fetchJson(fetch(`https://api.github.com/${path}?access_token=${accessToken}`)))
const fetchFromGithub = prepareGithubRequest(ACCESS_TOKEN)
const getReposFromOrg = org => fetchFromGithub(`orgs/${org}/repos`)
const getPopularRepos = R.compose(R.reverse, R.sortBy(R.prop('stargazers_count')), R.project(['name', 'stargazers_count', 'language']))

Mark items as read

We want to be able to track if a user has viewed/read an item. To do this we need a new endpoint.

My suggestion is to make the endpoint PATCH /items/mark-seen, the patch request body will contain an array of item ids.

E.g.:

{ 
 items: ['item id here', 'item id here']

Bugs:

  • no_submissions count is wrong. It seems to substract the total submissions from the amount of students/projects in a course. In the case that a teacher submits an assignment (which (s)he obviously shouldn't do, but it's possible) the count is wrong.
  • on_time=true||false both don't return any submissions.

Features:

The ability to query users/projects that have not submitted the assignment yet with no_submission=true||false query parameter.

<span style="color: rgb(0, 0, 0); font-family: Times; font-size: medium; line-height: normal;">It's been quite a while since my last blog. Let's go over what I've been doing and learning the last couple of weeks.</span><br style="color: rgb(0, 0, 0); font-family: Times; font-size: medium; line-height: normal;"><br style="color: rgb(0, 0, 0); font-family: Times; font-size: medium; line-height: normal;"><span style="color: rgb(0, 0, 0); font-family: Times; font-size: medium; line-height: normal;">As most of the readers may be aware, I'm working on the front-end of Projectcampus, and the front-end is made with a Google-backed&nbsp;framework called AngularJS.</span><br style="color: rgb(0, 0, 0); font-family: Times; font-size: medium; line-height: normal;"><br style="color: rgb(0, 0, 0); font-family: Times; font-size: medium; line-height: normal;"><span style="color: rgb(0, 0, 0); font-family: Times; font-size: medium; line-height: normal;">In the first couple of weeks I had a bit of a difficult time learning Ang
<section ng-if="::vm.item.description" class="item-description clearfix" ng-class="{'shorten': vm.shorten}" ng-bind-html="::vm.safeDescription"><p>I’ve been working on the Projectcampus Android application since September, and I must say I’ve learned a lot about Android and personally think the application is coming along nicely.</p>
<p>It all started as a very simple list of hardcoded data, but gradually grew to make use of various Android components such as a Content Provider, Authenticator, Sync Adapter and even custom views. Besides these components I’ve learned about using various mainstream libraries such as Retrofit, OkHttp, Glide, Butterknife, Eventbus, Crashlytics and the Android Support Library.</p>
<p>Retrofit powers the REST communication with the Projectcampus backend in combination with EventBus. EventBus is exactly what it sounds like, an event bus. This makes it possible to launch a REST request from anywhere in the application and also to allow any part of the application to receive any RES

Mentions

Requirements phase 1

  • Items will get a new property mentions which is an array. The array will contain user objects of users that have been mentioned.
  • Notification settings for mentions (mobile/email)
  • Don't send duplicate notifications (e.g. if a user places a comment on your item while also mentioning you in that comment, don't send two notifications, instead only send the mention notification).
  • Don't send notifications to the same users after an update, but do send notifications to new users that have been mentioned.
  • /search endpoint needs to be able to search in a context. Just like /search/items.
Message: This resource could not be created.
InnerException:
Stack Trace: at Microsoft.Xna.Framework.Audio.AudioEngine..ctor(String settingsFile, TimeSpan lookAheadTime, String rendererId)
at StardewValley.Game1.Initialize()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at StardewValley.Program.Main(String[] args)