Skip to content

Instantly share code, notes, and snippets.

View nekonenene's full-sized avatar

ハトネコエ nekonenene

View GitHub Profile
@nekonenene
nekonenene / config.yml
Last active May 23, 2019 19:48
CircleCI 2.0 で gh-pages にビルドしたものだけを push (ブログ公開用) https://nekonenene.hatenablog.com/entry/2018/08/21/052420
# Ref: https://circleci.com/docs/2.0/deployment-integrations/
version: 2
jobs:
build: # runs not using Workflows must have a `build` job as entry point
working_directory: ~/repo
docker:
- image: circleci/node:8 # 8系がLTSなので使用
steps:
- checkout # special step to check out source code to working directory
- run:
@nekonenene
nekonenene / update_proxy.sh
Last active August 7, 2018 02:05
ブログ公開用
#!/bin/bash
# $1: Update proxies to this ip
# $2: Update no_proxy to this ip list
function update_proxy() {
local proxy_ip="$1"
local no_proxy_list="$2"
if [ "$proxy_ip" = "" ] ; then
unset http_proxy
@nekonenene
nekonenene / kizuna_bot_for_blog.rb
Last active July 23, 2019 22:28
Discord bot。 gem install discordrb が必要(ブログ公開用) https://nekonenene.hatenablog.com/entry/2018/07/19/061201
require "discordrb"
require "net/http"
require "uri"
require "json"
# dotenv を使用する場合はここのコメントを解除します(※ gem install dotenv が必要)
# require "dotenv"
# Dotenv.load
class KizunaBot
@nekonenene
nekonenene / null.js
Created October 21, 2017 15:31
JavaScriptでのnullっぽい値の処理
var zero = 0;
var nullString = "";
var nullValue = null;
var undefinedValue = undefined;
var nanValue = NaN;
console.log("## xxx.toString");
console.log(zero + ", " + nullString + ", " + nullValue + ", " + undefinedValue + ", " + nanValue);
console.log("## ! xxx");
@nekonenene
nekonenene / using.rb
Last active July 21, 2017 02:42
refine / using で安全にオブジェクトへメソッド追加
module StringExtend
refine String do
def reverse
"aaa"
end
end
end
module TestModule
def output_from_module
@nekonenene
nekonenene / circle.yml
Last active May 23, 2019 19:56
ビルドしたものだけを gh-pages に push する(ブログ公開用) https://nekonenene.hatenablog.com/entry/2016/11/02/040706
general:
branches:
ignore:
- gh-pages
machine:
timezone: Asia/Tokyo
node:
version: v6.1.0
@nekonenene
nekonenene / .gitignore
Created September 10, 2016 14:17
ツクール用gitignore
### RPG Maker MV
movies/
save/
## pictures 以外の image フォルダを無視
img/animations
img/battlebacks1
img/battlebacks2
@nekonenene
nekonenene / Dockerfile
Last active October 25, 2016 13:47
最新の node, npm を入れる
FROM ubuntu:trusty
LABEL Description="latest npm" Vendor="nekonenene" Version="1.0"
## 文字コード設定
RUN locale-gen ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
@nekonenene
nekonenene / euclid.js
Created April 7, 2016 08:10
ES6 を用いたユークリッド互除法。しかし displayGcd メソッド内のログ出力は undefined となる
$(function()
{
var gcd = new GreatestCommonDivisor(14, 21);
var outputElement = $(".output");
outputElement.append( gcd.displayGcd() );
});
class GreatestCommonDivisor
{
@nekonenene
nekonenene / gulpfile.js
Created February 1, 2016 18:31
ブログ用: jsmin をおこなうための gulp 設定ファイル
var gulp = require("gulp");
/* gulp とコマンドを打つと実行される */
gulp.task("default", function() {
console.log("Starting gulp...!!");
gulp.watch(["./original/*.js"], ["compress"]);
});
var uglify = require("gulp-uglify");