Skip to content

Instantly share code, notes, and snippets.

View NetOpWibby's full-sized avatar
🌿
imagine being mad, touch grass

netop://ウィビ NetOpWibby

🌿
imagine being mad, touch grass
View GitHub Profile
# Description:
# イカレギュラーマッチのフェスステージ情報を返す(未完成)
#
# Notes:
# イカ、よろしくー
#
module.exports = (robot) ->
robot.respond /(イカ)/i, (msg) ->
resp = "ハイカラニュースの時間だよ!\n"
request_fes = msg.http("http://s3-ap-northeast-1.amazonaws.com/splatoon-data.nintendo.net/fes_info.json").get()
@dolpen
dolpen / splatoon_jsons.md
Last active February 8, 2016 18:59
裏イカ研究所

イカの情報をなんとかしてゲーム外から参照したい

  • イカの情報は、公式サイトへの情報反映用に一部がS3にjson形式で置いてあって、人間ががんばれば読めるようになっている
  • S3のベースURLは http://s3-ap-northeast-1.amazonaws.com/splatoon-data.nintendo.net/ である

現在分かっているもの

以下について、現ターム(4時間のアレ)と過去2ターム前までの情報が参照可能

@davidohlin
davidohlin / dn.js
Last active April 13, 2016 20:54
Remove all suggestions on what to do as a designer from Designer News.
var title;
var story;
var garbage = ["should", "designers"];
var stories = document.getElementsByClassName("list-story");
for (var i in stories) {
story = stories[i];
if ( story.classList.length === 1 ) {
title = story.getElementsByClassName("story-link")[0].getAttribute("alt").toLowerCase();
if ( check(garbage[0], title) && check(garbage[1], title) ) {
@japboy
japboy / 6to5
Last active June 29, 2016 14:49
A script to convert from ES6 to ES5
#!/usr/bin/env node --harmony
var fs = require('fs');
var path = require('path');
var browserify = require('browserify');
var f = fs.statSync(process.argv[2]).isFile() ? path.resolve(process.argv[2]) : '';
browserify({ debug: true })
@bloodyowl
bloodyowl / gist:6846108
Created October 5, 2013 21:14
Minify HTML files using nodeJS
var minify = require("minify")
, fs = require("fs")
, htmlRegExp = /\.html$/
, options = {encoding:"utf-8"}
fs.readdirSync("./dist").filter(isHTML).forEach(write)
function isHTML(item){
return htmlRegExp.test(item)
}
@lucianmarin
lucianmarin / parser.py
Last active May 13, 2017 00:10
Sublevel’s text to HTML parser.
from django.utils.safestring import mark_safe
def parser(text):
''' Convert plain text to HTML '''
limits = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'
digits = '0123456789'
# unicode xml safe
text = text.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
# replace &nbsp; (160) with space (32)
text = text.replace(chr(160), chr(32))
@asteadman
asteadman / md-to-html-example.html
Last active June 14, 2017 21:41
Convert basic markdown documents into something anyone can open with a web browser. Great for documentation.
<!-- turns markdown into html --><script type="text/javascript" src="md-to-html.js"></script>
# Heading
paragraph Text.
- list 1
- list 2
- list 3
And this is what code looks like:
@daifu
daifu / hasOwnProperty.js
Created July 24, 2012 02:07
javascript hasOwnProperty for object
if ( !Object.prototype.hasOwnProperty ) {
Object.prototype.hasOwnProperty = function(prop) {
var proto = obj.__proto__ || obj.constructor.prototype;
return (prop in this) && (!(prop in proto) || proto[prop] !== this[prop]);
};
}
@dmiro
dmiro / hasOwnProperty_correct_use.js
Last active August 8, 2017 19:53
hasOwnProperty correct use
var foo = {
hasOwnProperty: function() {
return false;
},
bar: 'Here be dragons'
};
foo.hasOwnProperty('bar'); // siempre devolverá false
// Utilice otro objeto con hasOwnProperty y llamelo con 'this' para asignarlo a foo
({}).hasOwnProperty.call(foo, 'bar'); // true
@ePirat
ePirat / startserver.js
Created August 11, 2011 23:54
Node js - Chat Server (NSFW)
Array.prototype.has = function(value) {
var i;
for (var i = 0, loopCnt = this.length; i < loopCnt; i++) {
if (this == value) {
return true;
}
}
return false;
};