Skip to content

Instantly share code, notes, and snippets.

Michał Załęcki MichalZalecki

Block or report user

Report or block MichalZalecki

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MichalZalecki
MichalZalecki / visor-archivos-online.md
Created Sep 5, 2016 — forked from izazueta/visor-archivos-online.md
Google Docs Viewer & Office Web Apps Viewer
View visor-archivos-online.md

Google Docs Viewer

Only files under 25 MB can be previewed with the Google Drive viewer.

Google Drive viewer helps you preview over 16 different file types, listed below:

  • Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  • Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  • Text files (.TXT)
  • Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  • Microsoft Word (.DOC and .DOCX)
@MichalZalecki
MichalZalecki / CycleRun.js
Created Jul 9, 2016
Mount Cycle.js app as react component
View CycleRun.js
import React, { PropTypes, Component } from "react";
import ReactDOM from "react-dom";
import { makeDOMDriver } from "@cycle/dom";
import { run } from "@cycle/xstream-run";
class CycleRun extends Component {
static propTypes = {
main: PropTypes.func.isRequired,
drivers: PropTypes.object,
};
View .editorconfig
root=true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
@MichalZalecki
MichalZalecki / mixins-decorators.js
Last active May 29, 2016
Multiple mixins by using extends/decorators/virtual methods/stamps
View mixins-decorators.js
function hi() {
console.log(`Hi ${this.name}!`);
}
function by() {
console.log(`By ${this.name}!`);
}
function mixin(fn, name = fn.name) {
return target => {
@MichalZalecki
MichalZalecki / index.js
Created Mar 12, 2016
How to import RxJS 5
View index.js
// Import all
import Rx from "rxjs/Rx";
Rx.Observable
.interval(200)
.take(9)
.map(x => x + "!!!")
.bufferCount(2)
.subscribe(::console.log);
@MichalZalecki
MichalZalecki / .eslintrc.json
Last active May 29, 2016
Reasonable .eslint confiig
View .eslintrc.json
{
"extends": "airbnb",
"parser": "babel-eslint",
"settings": {
"import/resolver": {
"webpack": { "config": "./webpack/webpack.prod.config.js" }
}
},
"rules": {
"quotes": ["error", "double"],
@MichalZalecki
MichalZalecki / await-async.js
Created Nov 13, 2015
Run generators and and await/async
View await-async.js
import axios from "axios";
export default async function () {
const { data: { id } } = await axios.get("//localhost:3000/id");
const { data: { group } } = await axios.get("//localhost:3000/group");
const { data: { name } } = await axios.get(`//localhost:3000/${group}/${id}`);
console.log(name); // Michał
}
View match.ts
function match<T, S>(value: T) {
let result: ()=>S;
const context = {
caseOf(fn:(value: T) => boolean, payload: ()=>S) {
if (!result && fn(value)) result = payload;
return context;
},
_(payload: ()=>S) {
if (!result) result = payload;
return context;
@MichalZalecki
MichalZalecki / style.js
Created Oct 24, 2015
Script transpiling CSS with cssnext
View style.js
const cssnext = require("cssnext");
const fs = require("fs");
const watch = require("node-watch");
const program = require("commander");
program
.version("0.0.1")
.option("-s, --source [path]", "Source file")
.option("-d, --destination [path]", "Destination file")
.option("-w, --watch [path]", "Watch directory")
@MichalZalecki
MichalZalecki / footer.js
Created Sep 2, 2015
React Templates vs JSX
View footer.js
You can’t perform that action at this time.