Skip to content

Instantly share code, notes, and snippets.

View Flcwl's full-sized avatar
💭
want to balance

PR. Flcwl

💭
want to balance
View GitHub Profile
@garyharan
garyharan / _mixins.scss
Created May 5, 2011 15:46
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
package org.krams.repository;
import org.krams.domain.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
public interface UserRepository extends JpaRepository<User, Long> {
@james2doyle
james2doyle / scrollTo.js
Last active October 25, 2024 14:12
a native scrollTo function in javascript that uses requestAnimationFrame and easing for animation
// easing functions http://goo.gl/5HLl8
Math.easeInOutQuad = function (t, b, c, d) {
t /= d/2;
if (t < 1) {
return c/2*t*t + b
}
t--;
return -c/2 * (t*(t-2) - 1) + b;
};
//试试用手机访问,可以看出结果哦
var ua = navigator.userAgent;
isAndroid = /Android/i.test(ua);
isBlackBerry = /BlackBerry/i.test(ua);
isWindowPhone = /IEMobile/i.test(ua);
isIOS = /iPhone|iPad|iPod/i.test(ua);
isMobile = isAndroid || isBlackBerry || isWindowPhone || isIOS;
if(isAndroid) isMobile = 'android';
if(isBlackBerry) isMobile = 'BlackBerry';
@roachhd
roachhd / README.md
Last active November 13, 2024 20:51
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@lukehorvat
lukehorvat / es6-map-to-object-literal.js
Last active January 8, 2024 10:32
Convert ES6 Map to Object Literal
let map = new Map();
map.set("a", 1);
map.set("b", 2);
map.set("c", 3);
let obj = Array.from(map).reduce((obj, [key, value]) => (
Object.assign(obj, { [key]: value }) // Be careful! Maps can have non-String keys; object literals can't.
), {});
console.log(obj); // => { a: 1, b: 2, c: 3 }
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@bitzip
bitzip / .scss-lint.yml
Last active February 26, 2019 09:25
个人偏好的scss-lint配置,带中文注释
# 建议:官方文档对每个规则有简单易懂的例子说明,有时间的同学可以查阅一遍。
# 官方文档 https://github.com/brigade/scss-lint/blob/master/lib/scss_lint/linter/README.md
# 默认配置 https://github.com/brigade/scss-lint/blob/master/config/default.yml
# 版本:0.41.0
# 以下是个人偏好配置
scss_files: "**/*.scss"
plugin_directories: ['release']
@fj-auto
fj-auto / dpr.js
Last active April 23, 2020 04:22
移动端web伸缩方案
var dpr, rem, scale,
docElem = document.documentElement,
fontElem = document.createElement('style'),
metaElem = document.querySelector('meta[name="viewport"]');
dpr = window.devicePixelRatio || 1; // 获取屏幕dpi, default设为1
rem = docElem.clientWidth * dpr / 10; // 根据屏幕宽度和dpr来动态计算base 'rem' font-size, 取10是为了好计算
scale = 1 / dpr; // 不用再傻傻的拿[设计稿/2];
// 同时也处理retina屏幕下border: 1px的情况;
@A-limon
A-limon / math_util.js
Last active July 2, 2021 02:17
解决JavaScript浮点数计算的问题
;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root._Math = factory();
}
}(this, function() {
var _Math = {