Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

jeong seong dae jeongsd

View GitHub Profile
View index.js
var timer = 5000;
var idleImg = "https://i.imgur.com/7LYQc5Y.jpg";
var idleSound = 'http://soundbible.com/mp3/Female_Scream_Horror-NeoPhyTe-138499973.mp3';
eval(` (function(){var a;document.addEventListener||(document.attachEvent?document.addEventListener=function(a,b,c){return document.attachEvent("on"+a,b,c)}:document.addEventListener=function(){return{}}),document.removeEventListener||(document.detachEvent?document.removeEventListener=function(a,b){return document.detachEvent("on"+a,b)}:document.removeEventListener=function(){return{}}),a={},a=function(){function a(a){var b,c;a&&(this.awayTimeout=parseInt(a.awayTimeout,10),this.onAway=a.onAway,this.onAwayBack=a.onAwayBack,this.onVisible=a.onVisible,this.onHidden=a.onHidden),c=this,b=function(){return c.onActive()},window.addEventListener("click",b),window.addEventListener("mousemove",b),window.addEventListener("mouseenter",b),window.addEventListener("keydown",b),window.addEventListener("scroll",b),window.addEventListener("mousewheel",b),window.addEventLis
View loadcss.js
function loadCss(filename) {
var cssNode = document.createElement("link");
cssNode.setAttribute("rel", "stylesheet");
cssNode.setAttribute("type", "text/css");
cssNode.setAttribute("href", filename);
document.getElementsByTagName("head")[0].appendChild(cssNode);
}
loadCss("https://cdn.jsdelivr.net/npm/animate.css@3.5.2/animate.min.css")
@jeongsd
jeongsd / RouteConst.js
Created Jul 21, 2017
react router constants
View RouteConst.js
import pathToRegexp from 'path-to-regexp';
class RouteConst {
constructor(path, parent = null) {
this.path = parent ? `${parent.path}${path}` : path;
this.toURL = pathToRegexp.compile(this.path);
}
}
@jeongsd
jeongsd / 0_reuse_code.js
Created May 23, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View react compoent shotcut
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
const Styled__placeholder__ = styled.div`
`;
class __placeholder__ extends Component {
static propTypes = {
@jeongsd
jeongsd / limitLoop.js
Created Mar 5, 2017 — forked from addyosmani/limitLoop.js
Limit the frame-rate being targeted with requestAnimationFrame
View limitLoop.js
/*
limitLoop.js - limit the frame-rate when using requestAnimation frame
Released under an MIT license.
When to use it?
----------------
A consistent frame-rate can be better than a janky experience only
occasionally hitting 60fps. Use this trick to target a specific frame-
rate (e.g 30fps, 48fps) until browsers better tackle this problem
@jeongsd
jeongsd / AnimationFrame.js
Last active Mar 5, 2017 — forked from addyosmani/limitLoop.js
Limit the frame-rate being targeted with requestAnimationFrame
View AnimationFrame.js
/*
http://cssdeck.com/labs/embed/gvxnxdrh/0/output
http://codetheory.in/controlling-the-frame-rate-with-requestanimationframe/
*/
class AnimationFrame {
constructor(fps = 60, animate) {
this.requestID = 0;
this.fps = fps;
this.animate = animate;
}
View calculator.py
#!/usr/bin/env python3
import math
import collections
import types
def main():
quit = "Ctrl+Z, Enter"
prompt = "Enter an expression ({} to quit): ".format(quit)
current = types.SimpleNamespace(letter="A")
globalContent = global_context()
You can’t perform that action at this time.