Skip to content

Instantly share code, notes, and snippets.

View mzbac's full-sized avatar
🦀
I may be slow to respond.

Anchen mzbac

🦀
I may be slow to respond.
  • Australia
  • 12:17 (UTC +10:00)
View GitHub Profile
<div style={{ width: '100%', height: '0', position: 'relative', paddingBottom: '56.25%' }} >
<iframe
style={{ width: '100%', height: '100%', position: 'absolute', top: '0', left: '0
@mzbac
mzbac / currying.js
Created December 1, 2016 06:00 — forked from kiddkai/currying.js
curry
/**
* curry
*
* var curried = curry(function(a, b, c) {
* console.log(a+b+c);
* });
*
*
* curried(2)(2)(2); // => 6
* curried(2,2)(2); // => 6
body,
html,
.parent {
height: 100%;
width: 100%;
text-align: center;
padding: 0;
margin: 0;
}
.parent {
require('postcss-cssnext')({
browsers: ['last 2 versions', 'Chrome >= 42', 'Firefox >= 38', 'iOS >= 7', 'Android >= 4']
}),
BROWSERSLIST_CONFIG=./browserslist
var Promise = require('bluebird');
function request() {
return new Promise(function (resovle, reject) {
setTimeout(function() {
var num = Math.random();
if(num > 0.8){
resovle(num);
}else{
reject(num);
}
@mzbac
mzbac / rxjs_operators_by_example.md
Created January 3, 2017 00:20 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
HtmlWebpackPlugin usindg generated index.html
webpack --color --watch & webpack-dev-server --inline --hot --content-base ./build
// Press ctrl+space for code completion
export default function transformer(file, api) {
const j = api.jscodeshift;
return j(file.source)
.find(j.CallExpression,{callee: {name: 'require'}})
.forEach(path => {
console.log(path.value.arguments[0].value);
path.value.arguments[0].value ='test';
})
// Press ctrl+space for code completion
export default function transformer(file, api) {
const j = api.jscodeshift;
const root = j(file.source);
const guidInstanceVariableNames = [];
let guidIdentifier = undefined;
root
.find(j.ImportDeclaration, {
source: { value: "guid" }
})