Skip to content

Instantly share code, notes, and snippets.

mpr0xy mpr0xy

View GitHub Profile
View ip算法 位移
function ip(str) {
var length = str.length;
var ans = 0;
var stack = [];
var step = 0;
var lastStep = 0;
var lastchar = ''
// 处理每一次位移
function handle() {
View ip算法
function ip(str) {
var length = str.length;
var ans = [];
var stack = [];
var step = 0;
var lastStep = 0;
var lastchar = ''
// 生成原始数组
for (var i = 0; i < 32; i++) {
@mpr0xy
mpr0xy / drag-drop-upload-unzip.js
Created May 31, 2016 — forked from iwek/drag-drop-upload-unzip.js
Drag and Drop, Upload and Unzip
View drag-drop-upload-unzip.js
/* Drag'n drop stuff */
var drag = document.getElementById("drag");
drag.ondragover = function(e) {e.preventDefault()}
drag.ondrop = function(e) {
e.preventDefault();
var length = e.dataTransfer.items.length;
for (var i = 0; i < length; i++) {
var entry = e.dataTransfer.items[i].webkitGetAsEntry();
var file = e.dataTransfer.files[i];
View gist:6037ceeca4c8ba0458ee
graphql,Postgres,graphql-relay-js,前端: relay
@mpr0xy
mpr0xy / mp-gulp-img-src.js
Last active Aug 29, 2015
mp-gulp-img-src
View mp-gulp-img-src.js
var through = require('through2');
module.exports = function() {
return through.obj(function (file, enc, cb) {
if (file.isNull()) {
cb(null, file);
return;
}
if (file.isStream()) {
cb(new gutil.PluginError('gulp-mp-upai-upload', 'Streaming not supported'));
@mpr0xy
mpr0xy / parseFile.js
Created Jun 8, 2014
解析一个md文件前面加入得一些描述信息(比如写一篇博客会包含得信息)
View parseFile.js
var fs = require('fs');
var yamlish = require('yamlish'); // npm install yamlish
// md文件头部类似下面的注释信息,为了不会于文章里的注释符号冲突,加了>>
// 第一行需要时空行,因为yamlish库是从第二行开始解析得,你妹啊
/*<<
You can’t perform that action at this time.