Skip to content

Instantly share code, notes, and snippets.

View fayimora's full-sized avatar
🕺

Fayi FB fayimora

🕺
  • London, England
View GitHub Profile
@fayimora
fayimora / tracker-list.txt
Created February 11, 2024 23:04 — forked from FFY00/tracker-list.txt
Torrent Trackers
http://104.28.1.30:8080/announce
http://104.28.16.69/announce
http://107.150.14.110:6969/announce
http://109.121.134.121:1337/announce
http://114.55.113.60:6969/announce
@fayimora
fayimora / components.hider-component.js
Last active April 18, 2017 14:21 — forked from courajs/components.hider-component.js
Conditionally rendered components
import Ember from 'ember';
import through from '../indirect';
// Inlined, since no addons in twiddles. Really use this:
// import through from 'ember-computed-indirect/utils/indirect';
export default Ember.Component.extend({
user: Ember.inject.service('user-permissions'),
flagName: '', // specify in extending component
flagPath: Ember.computed('flagName', function() {
return 'user.permissions.' + this.get('flagName');

I think the better approach is to know what is a Functor before asking about Monads.

A Functor is a Higher Kinded Type/Type Constructor/Function at the type level that has a certain shape (that is, it implements a map function). A Functor is also what's known as a typeclass. A Monad is also a typeclass

Typeclasses are a form of ad-hoc polymorphism that let you add functionality to existing code that you may or may not have written.

Here's is the basic definition of a Functor

trait Functor[F[_]] {
 def map[A, B](fa: F[A])(f: A => B): F[B]
@fayimora
fayimora / controllers.application.js
Created November 10, 2016 22:17 — forked from poteto/controllers.application.js
ember-changeset-validations demo
import Ember from 'ember';
import AdultValidations from '../validations/adult';
import ChildValidations from '../validations/child';
import { reservedEmails } from '../validators/uniqueness';
import { schema } from '../models/user';
const { get } = Ember;
const { keys } = Object;
export default Ember.Controller.extend({
@fayimora
fayimora / gist:1684e834e853c95a1b7b
Created February 21, 2016 00:15 — forked from neciu/gist:6bfeab3e3ae38638d8fb
Added hax enabling auto filing from existing models/properties.

Integrating TinyMCE in an ember-cli app

TinyMCE is a javascript WYSIWYG editor that is highly configurable and has a ton of features and plugins. It integrates with jQuery and, with a bit of work, it can be integrated in your ember-cli app.

Step 1: Install TinyMCE:

bower install --save tinymce

Step 2: Import the required files into your app via broccoli. In order to do that you will need a plugin called broccoli-static-compiler:

@fayimora
fayimora / android_lexer.rb
Created February 18, 2016 10:54 — forked from maxlinc/android_lexer.rb
Workaround for java vs android in slate
require 'rouge'
module Rouge
module Lexers
class Android < Rouge::Lexers::Java
tag 'android'
end
end
end
.hll { background-color: #ffffcc }
.c { color: #586E75 } /* Comment */
.err { color: #93A1A1 } /* Error */
.g { color: #93A1A1 } /* Generic */
.k { color: #859900 } /* Keyword */
.l { color: #93A1A1 } /* Literal */
.n { color: #93A1A1 } /* Name */
.o { color: #859900 } /* Operator */
.x { color: #CB4B16 } /* Other */
.p { color: #93A1A1 } /* Punctuation */
/* global google */
var GoogleMapComponent = Ember.Component.extend({
places: [],
width: 500,
height: 500,
attributeBindings: ['style'],
style: function () {
return 'width:'+this.width+'px; height:'+this.height+'px';
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
@fayimora
fayimora / Quine.c
Created December 5, 2013 15:17 — forked from nocturnalact/Quine.c
/** my sample quine code**/ #include <stdio.h>
static char quine[] = "\n\t\\\"";
int main(void) {
const char *code = "/** my sample quine code**/ #include <stdio.h>%c%cstatic char quine[] = %c%cn%ct%c%c%c%c%c;%c%cint main(void) {%c%cconst char *code = %c%s%c;%c%cprintf(code, quine[0], quine[0], quine[3], quine[2], quine[2], quine[2], quine[2], quine[2], quine[3], quine[3], quine[0], quine[0], quine[0], quine[1], quine[3], code, quine[3], quine[0], quine[1], quine[0], quine[0], quine[1], quine[0], quine[0]);%c%c%creturn 0;%c}%c";
printf(code, quine[0], quine[0], quine[3], quine[2], quine[2], quine[2], quine[2], quine[2], quine[3], quine[3], quine[0], quine[0], quine[0], quine[1], quine[3], code, quine[3], quine[0], quine[1], quine[0], quine[0], quine[1], quine[0], quine[0]);
return 0;
}