Skip to content

Instantly share code, notes, and snippets.

View ba0918's full-sized avatar

ba0918 ba0918

  • Japan
View GitHub Profile
@ba0918
ba0918 / index.js
Last active December 31, 2017 20:33
積みゲー帝国のプレゼント応募ページからSteamゲームのアプリIDを無理やり抽出するやつ
const puppeteer = require("puppeteer");
const URL =
"https://docs.google.com/document/d/1VsNgXtlCBIhaDBXh5AFBczz-Yn5akh2dERMcksuUJIQ/";
async function getGameUrlsFrom(pageURL) {
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.goto(pageURL);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ba0918
ba0918 / UrlDomainValidator.php
Last active April 30, 2017 15:36
URLごにょごにょするやつ
<?php
class UrlDomainValidator
{
protected $domains = [];
public function __construct(array $domains = [])
{
$this->domains = $domains;
}
@ba0918
ba0918 / bookmarklet.md
Last active February 16, 2016 01:12
クッキー焼くのちょっと楽にする

ブックマークレット

javascript:(function(d,s){s=d.createElement('script');s.src='https://cdn.rawgit.com/ba0918/60f7acb191b7560d75d1/raw/ca8e72117b4cae98065e5f4abb641c998d6d0f80/test.js';d.body.appendChild(s);})(document);
@ba0918
ba0918 / gitlab-manual-install.md
Last active January 21, 2016 10:01
GitLab7.0をCentOS5.8に入れた時のメモ
@ba0918
ba0918 / attributes_default.rb
Last active August 29, 2015 13:57
pythonインスコするレシピ
default[:python][:versions] = ['2.7.6', '3.2.5', '3.3.5']
default[:python][:use_version] = '2.7.6'
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-typescript'
grunt.loadNpmTasks 'grunt-browserify'
grunt.loadNpmTasks 'grunt-clean-contrib'
grunt.initConfig
typescript:
app:
src: ['src/**/*.ts']
options:
module: 'commonjs'
@ba0918
ba0918 / fizzbuzz.coffee
Created January 27, 2014 05:05
CoffeeScriptでFizzBuzz?
for n in [0..100]
if n % 15 == 0 then console.log 'fizzbuzz'
else if n % 3 == 0 then console.log 'fizz'
else if n % 5 == 0 then console.log 'buzz'
else console.log n
@ba0918
ba0918 / app.coffee
Last active January 2, 2016 21:48
WebSocket試した
EventEmitter = require('events').EventEmitter
WebSocketServer = require('ws').Server
WebSocketClient = require 'ws'
class ChatServer
constructor: ->
@server = new WebSocketServer { port: 80 }
@server.on 'connection', @onConnection
console.log "started server."