Skip to content

Instantly share code, notes, and snippets.

View claeusdev's full-sized avatar
🏠
Working from home

Nana Adjei Manu claeusdev

🏠
Working from home
View GitHub Profile
@claeusdev
claeusdev / app.js
Created July 28, 2018 16:23
hey there
​x 1this ins markdown
@claeusdev
claeusdev / App.js
Created July 28, 2018 16:35
hey there
 1contaraints
@claeusdev
claeusdev / app.js
Created July 29, 2018 16:41
get in there and check it out
​x 1this ins markdown
.modal.fade#newNoteModal{tabindex: '-1', role: 'dialog', aria: {labelledby: "newNoteModalLabel"}}
.modal-dialog{role: 'document'}
.modal-content
.modal-header
%h5.modal-title#newNoteModalLabel Add new note
%button.close{type: 'button', data: {dismiss: 'modal'}, aria: {label: "Close"}}
.modal-body
.modal-footer
import DS from 'ember-data';
const {attr, hasMany, belongsTo} = DS
// Employee-dataset
export default DS.Model.extend({
label: attr("string"),
bestuurseenheid: belongsTo("bestuurseenheid"),
periods: hasMany("employee-period-slice")
});
@claeusdev
claeusdev / learn-react.md
Created January 18, 2020 23:21 — forked from sagirk/learn-react.md
How to become a React expert
  1. Carefully do the official [tutorial][].
  2. Read the official guide to [main concepts][].
  3. Read the official [advanced guides][].
  4. Watch [building React from scratch][] to get an idea of how React actually works (this covers the "stack" reconciler which was used in React 15 and earlier).
  5. Go through the [React "fiber" architecture][] which is the default reconciler since React 16.
  6. Go crazy, build your own projects, and stop doing React tutorials!
@claeusdev
claeusdev / Stack.js
Created February 23, 2020 12:18
Simple implementation of a Stack data structure in js
var Stack = function(capacity){
this.capacity = capacity || Infinity
this.storage = {}
this.size = 0
}
Stack.prototype.push = function(val){
if(this.size < this.capacity){
this.storage[this.size] = value
return this.size
Queue.prototype.enqueue = function(value){
if(this.size < this.capacity){
this.storage[this.tail++] = value
return this.size
}
return "Max capacity reached, remove one before you can add another."
}
import { useState, useEffect, useCallback } from "react";
import { server } from "./server";
interface State<TData> {
data: TData | null;
loading: boolean;
error: boolean;
}
export const useQuery = <TData = any>(query: string) => {
const [state, setState] = useState<State<TData>>({
class Admin::AdminPostsController < InheritedResources::Base
layout 'admin'
before_filter :require_login
before_action :set_post
before_action :set_branches
before_action :set_sections
load_and_authorize_resource
def index