Skip to content

Instantly share code, notes, and snippets.

name: Action Sample
on:
push:
branches:
- master
workflow_dispatch:
jobs:
job_id:
@flexphere
flexphere / BubbleSort.js
Created September 28, 2020 03:12
BubbleSort
const bubbleSort = (arr) => {
let len = arr.length - 1;
let isSorted = true;
for (let i = 0; i < len; i++) {
for (let j = 0; j < len - i; j++) {
if (arr[j] > arr[j + 1]) {
const tmp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = tmp;
@flexphere
flexphere / docker-compose.yml
Created June 17, 2020 23:39
wordpress 5.4.2
version: "3"
services:
database:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: wp
MYSQL_USER: root
MYSQL_PASSWORD: pass
MYSQL_ROOT_PASSWORD: pass
const chromeLauncher = require('chrome-launcher');
const CDP = require('chrome-remote-interface');
(async function() {
async function launchChrome() {
return await chromeLauncher.launch({
chromeFlags: [
'--disable-gpu'
//,'--headless'
]
@flexphere
flexphere / file0.txt
Created June 22, 2018 18:01
chromelessを日本語対応するよ! ref: https://qiita.com/flexphere/items/b896fbc89bb1a36f1e83
$ git clone https://github.com/graphcool/chromeless.git
$ cd chromeless/serverless
$ npm install
@flexphere
flexphere / text-masking.html
Last active September 30, 2016 16:26
material-iconsに対するwebkit-background-clipによるテキストクリッピングサンプル
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style>
section {
text-align: center;
}
@flexphere
flexphere / bottomposition.jquery.js
Created June 9, 2016 11:10
simple jquery plugin
;(function($, undefined) {
"use strict";
$.fn.bottomPosition = function() {
console.log('offset.top:'+ this.offset().top);
console.log('outerHeight:'+ this.outerHeight());
return this.offset().top + this.outerHeight();
};
})(jQuery);
@flexphere
flexphere / compare
Created June 6, 2016 14:53
pjax+php
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Compare</title>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.pjax/1.9.6/jquery.pjax.js"></script>
</head>
<body>
<header>
@flexphere
flexphere / script2.js
Last active May 9, 2016 15:38
モジュール化の例2
function scrollMenu(){
//初期設定(position設定など)
var breakpoint = 200,
$(window).resize(onResize);
$(window).scroll(onScroll);
function setBreakpoint(){
//resize時の処理
}
@flexphere
flexphere / script.js
Last active May 9, 2016 15:13
モジュール化の例
//ankhオブジェクトの作成
var ankh = new Object();
//カルーセル
ankh.carousel = {
_target: '.carousel', //モジュール全体で使うカルーセル化する対象セレクタ
load: function(){