Skip to content

Instantly share code, notes, and snippets.

my atom
// 1. Go to https://twitter.com/following.
// 2. Keep scrolling to the bottom repeatedly until all your followers are loaded.
// 3. Run this in your console.
[].slice.call(document.querySelectorAll('.unfollow-text')).forEach(function(button) {
button.click();
});
@suncn
suncn / Mac开机启动.md
Last active May 8, 2017 01:17
mac 设置开机启动项
  1. 选择“系统偏好设置”中的“用户与群组”

  2. 选择“登陆项”选项卡

  3. 勾选不需要的开机启动项,然后点击“-”按钮删除

  4. 如果要增加开机启动项,点击“+”按钮,选择需要开自己启动的项目就行

@suncn
suncn / gulpfile.js
Last active May 8, 2017 08:39 — forked from yukal/gulpfile.js
gulp
'use strict';
const gulp = require('gulp'),
watch = require('gulp-watch'),
prefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
less = require('gulp-less'),
requirejsOptimize = require('gulp-requirejs-optimize'),
sourcemaps = require('gulp-sourcemaps'),
rigger = require('gulp-rigger'),
@suncn
suncn / sliderImg
Created July 25, 2017 02:24
css3实现的简单网页滚动
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
* {
@suncn
suncn / sample.js
Last active August 8, 2017 06:33
页面加载完成执行事件load
document.addEventListener("DOMContentLoaded", function() {
// ...代码...
}, false);
window.addEventListener("load", function() {
// ...代码...
}, false);
@suncn
suncn / history.md
Last active August 9, 2017 04:38
HTML5 history API #history
@suncn
suncn / method.md
Last active August 17, 2017 02:31
修改github仓库 #remote 关联
  • 先删除后添加

    • git remote rm origin
    • git remote add origin [url]
  • 直接修改config文件

@suncn
suncn / css.less
Created August 21, 2017 03:36
吸顶效果 解决方案 #-webkit-sticky
.position(@propVal: absolute){
position: @propVal;
left: 0;
right: 0;
top: 0;
}
.sticky{
.position(-webkit-sticky);
}
var os=require('os'),
iptable={},
ifaces=os.networkInterfaces();
for (var dev in ifaces) {
ifaces[dev].forEach(function(details,alias){
if ((details.family=='IPv4') && (details.internal == false)) {
// iptable[dev+(alias?':'+alias:'')]=details.address;
iptable['localIP'] = details.address;
}