Skip to content

Instantly share code, notes, and snippets.

View peterfei's full-sized avatar
💭
I may be slow to respond.

peterfei peterfei

💭
I may be slow to respond.
View GitHub Profile
@peterfei
peterfei / gist:e5b9b42c7f50dcdf7b275057f75c80bb
Created September 9, 2023 08:49
又拍云本地上传云图片脚本
-> % cat /usr/local/bin/upyun.sh
#!/bin/bash
# 云存储服务的名称
bucket="xxx"
# 上传默认的路径
file_path="/"
# 操作员
operator="peterfei"
# 操作人密码
@peterfei
peterfei / Dockerfile
Created September 19, 2019 06:30 — forked from remarkablemark/Dockerfile
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
@peterfei
peterfei / SQLite.cs
Created April 18, 2019 03:12
给Unity提供的SQLite封装类
//
// Copyright (c) 2009-2012 Krueger Systems, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@peterfei
peterfei / .vimrc
Last active October 27, 2020 02:17
set noswapfile
set bufhidden=hide
set nu
set hidden
autocmd FileType css,scss,slim,html,eruby,coffee,javascript setlocal iskeyword+=-
filetype on
filetype indent on
filetype plugin on
filetype plugin indent on
set autoread
set nocompatible " be iMproved
" 1 tab to 2 space for ruby
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
" number line show
set nu
@peterfei
peterfei / git-recover-branch.md
Created July 18, 2017 05:01 — forked from jbgo/git-recover-branch.md
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

@peterfei
peterfei / Gemfile
Created October 25, 2015 04:26 — forked from msg7086/Gemfile
source 'https://rubygems.org'
gem 'activesupport'
gem 'rspec-rails'
@peterfei
peterfei / css_resources.md
Last active August 29, 2015 14:06 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@peterfei
peterfei / javascript_resources.md
Last active August 29, 2015 14:06 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage