Skip to content

Instantly share code, notes, and snippets.

View uruly's full-sized avatar
☂️

Reo uruly

☂️
View GitHub Profile
const defaultColor = 'rgb(255, 255, 0)';
const stopColor = 'rgb(37, 37, 37)';
/**
* Scroll
*/
window.onscroll = scrollWindow;
/**
* スクロールされている間呼ばれる
//
// TableViewController.swift
// MultipleCollectionView
//
// Created by Reo on 2019/11/08.
// Copyright © 2019 uruly.xyz. All rights reserved.
//
// I partially copied the following code.
// https://qiita.com/abouch/items/aca979b71ad792478687
@uruly
uruly / archive-external-link.php
Last active November 11, 2022 08:23
Make WordPress custom post title an external link
@uruly
uruly / RealmMigration.swift
Last active July 16, 2020 05:35
Realm マイグレーション処理用
//
// RealmMigration.swift
//
// Created by Reo on 2020/07/16.
// Copyright © 2020 uruly.xyz. All rights reserved.
//
import UIKit
import RealmSwift
//
// CameraViewController.swift
// CameraTest
//
// Created by Reona Kubo on 2019/07/08.
// Copyright © 2019 Reona Kubo. All rights reserved.
//
import UIKit
import AVFoundation
@uruly
uruly / additional-post-plugin.php
Created September 10, 2018 10:46
WordPress Plugin.
<?php
/*
Plugin Name: Additional Post Plugin
Description: 投稿ページに追記欄を作成する
Version: 1.0
Author: Reo
*/
define( 'ADDPP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
<?php
/**
*
* News_Posts_Plugin Common Settings .
*
*/
if ( !class_exists('News_Posts') ) {
exit;
}
// Google API Login
function youtubeLogin() {
gapi.load('client:auth2', () => {
gapi.client.init({
apiKey: config.apiKey,
clientId: config.clientId,
discoveryDocs: config.discoveryDocs,
scope: config.scopes.join(' '),
}).then(() => {
gapi.client.load('youtube', 'v3', () => {
window.onload = function() {
var header = document.querySelector('header');
var headerOffsetY = header.offsetTop;
window.onscroll = function() {
var offsetY = window.pageYOffset;
if (headerOffsetY > offsetY) {
//ここで固定解除( 元々のものに戻す )
header.style.position = 'absolute';
header.style.top = '';
header.style.bottom = '0';
@uruly
uruly / index.html
Created July 14, 2018 13:19
Stop Scroll - Pure JavaScript
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>