Skip to content

Instantly share code, notes, and snippets.

@suziewong
suziewong / git.md
Last active February 19, 2023 05:38
Git的多账号如何处理? 1.同一台电脑多个git(不同网站的)账号 2.同一台电脑多个git(同一个网站的比如github的)多个账号

1.同一台电脑可以有2个git账号(不同网站的)

首先不同网站,当然可以使用同一个邮箱,比如我的github,gitlab,bitbucket的账号都是monkeysuzie[at]gmail.com 这时候不用担心密钥的问题,因为这些网站push pull 认证的唯一性的是邮箱 比如我的windows 上 2个账号一个gitlab 一个github (用的都是id_rsa)

host github
  hostname github.com
  Port 22

host gitlab.zjut.com

// To disable socket.io, disable the sockets hook (you'll have to disable the pubsub hook as well)
// This is a replacement for the default app.js file:
require('sails').lift({
hooks: {
sockets: false,
pubsub: false
}
@jgoux
jgoux / app.js
Created April 15, 2014 14:53
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@tadyjp
tadyjp / RootTableViewController.swift
Created June 14, 2014 05:16
Nested table view controller
//
// RootTableViewController.swift
// NestedTableView
//
// Created by tady on 6/14/14.
// Copyright (c) 2014 tady. All rights reserved.
//
import UIKit
@codetalks-new
codetalks-new / UIView+PinAutoLayout.swift
Last active February 19, 2020 09:58
简单的AutoLayout封装, 简化80% 的AutoLayout 手写代码
//
// UIView+PinAutoLayout.swift
// banxi1988
// @LastModified 2015/06/12
// Created by banxi1988 on 15/5/28.
// Copyright (c) 2015年 banxi1988. All rights reserved.
//
import UIKit
@52cik
52cik / npm.taobao.sh
Last active February 29, 2024 02:56
npm 淘宝镜像配置
npm set registry https://r.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像
npm set ELECTRON_MIRROR https://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像
@imilu
imilu / JS阿拉伯数字转罗马数字.md
Created July 19, 2016 03:07
JS阿拉伯数字转罗马数字

学习了一种很有意思的进制(姑且这么说吧...)转换方式。 原理就是利用键值对+循环遍历。

第一次遇见这个方法是在一本讲Python的书里面,(不记得什么名字了,以后翻出来在补上。) 当时颇不以为然,第二次见到才醒悟,觉得这是一个不错的方法。

代码

function convert(num) {
@acdlite
acdlite / coordinating-async-react.md
Last active June 17, 2024 11:56
Demo: Coordinating async React with non-React views

Demo: Coordinating async React with non-React views

tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.

A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.

But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.

How do we solve this with React?

@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active June 18, 2024 09:59
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@v1vendi
v1vendi / api_generator.js
Created August 20, 2019 19:19
REST API functional generator
const fetch = (...args) => console.log(...args) // mock
function httpRequest(url, method, data) {
const init = { method }
switch (method) {
case 'GET':
if (data) url = `${url}?${new URLSearchParams(data)}`
break
case 'POST':
case 'PUT':
case 'PATCH':