Skip to content

Instantly share code, notes, and snippets.

View alchen's full-sized avatar
💭
Sad.

Alex alchen

💭
Sad.
View GitHub Profile
@alchen
alchen / production_env.css
Created July 6, 2023 04:18
Stylizer Demo
body:before{
content: '本番環境';
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 9999;
color: #F00;
@alchen
alchen / newTweet.js
Last active December 18, 2015 07:30
Partial mithril.js implementation of timeline display for alchen/DTCP
'use strict';
var m = require('./mithril');
var twitterText = require('twitter-text');
var newTweet = {};
newTweet.Tweet = function Tweet(status) {
status = status || '';
this.status = m.prop(status);
@alchen
alchen / detectViewport.js
Created May 31, 2015 00:24
Vue.js viewport detect
'use strict';
function isElementInViewport (el) {
var rect = el.getBoundingClientRect();
return rect.bottom > 0
&& rect.right > 0
&& rect.top < (window.innerHeight || document.documentElement.clientHeight)
&& rect.left < (window.innerWidth || document.documentElement.clientWidth);
}
@alchen
alchen / editor.js
Created May 29, 2015 10:49
CodeMirror for Tweets
/*jslint latedef:false*/
'use strict';
var CodeMirror = require('codemirror');
var twitterText = require('twitter-text');
CodeMirror.defineSimpleMode = function(name, states) {
CodeMirror.defineMode(name, function(config) {
return CodeMirror.simpleMode(config, states);
});