Skip to content

Instantly share code, notes, and snippets.

View FrankFang's full-sized avatar
🎯
Focusing

Frank Fang FrankFang

🎯
Focusing
View GitHub Profile
@Hyvi
Hyvi / .vimrc
Created March 4, 2012 09:12
vim配置
nmap <F2> a<C-R>=strftime("%c")<CR><Esc>
"http://stackoverflow.com/questions/69998/tabs-and-spaces-in-vim
set tabstop=4
set shiftwidth=4
set expandtab
call pathogen#infect()
syntax on
filetype plugin indent on
@sergej-brazdeikis
sergej-brazdeikis / cssPrefixes.less
Created July 21, 2012 11:43
Less.js function which generates all prefixes for given CSS property
/* Less.js function which generates prefixes any CSS property */
.pf(@prop, @value){
-:~`";"+"@{prop}:@{value};-webkit-@{prop}:@{value};-moz-@{prop}:@{value};-o-@{prop}:@{value};-ms-@{prop}:@{value}".replace(/'/g,"")`;
}
#container {
.pf('border-radius', 10px);
.pf('transform', 'rotate(7deg)');
.pf('transition','all 1s ease-in-out');
.pf('box-shadow','2px 2px 5px 0 rgba(0,0,0,.6)');
@FrankFang
FrankFang / simple_reset.css
Last active December 16, 2015 11:49
simple reset
* { margin: 0; padding: 0; }
ul, ol, dl { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: normal; }
body { font: 14px/1.6 tahoma, arial, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif; }
a { text-decoration: none; color: #000; }
imgi { border: none; }
@abruzzi
abruzzi / contact-controller.js
Created December 31, 2013 14:25
nested views in angularjs
var app = angular.module('MyApp');
app.controller('ContactController', ['$scope', function($scope) {
$scope.contacts = ["juntao", "abruzzi"];
$scope.submit = function() {
$scope.$parent.toggleContactsPanel();
};
}]);
@pizn
pizn / category_plugin.rb
Created February 24, 2012 08:47
category plugin for jekyll blog
module Jekyll
class CategoryIndex < Page
def initialize(site, base, dir, category)
@site = site
@base = base
@dir = dir
@name = 'index.html'
self.process(@name)
@zires
zires / unicorn.rb
Created June 1, 2011 19:03
unicorn configuration
# Sample verbose configuration file for Unicorn (not Rack)
#
# This configuration file documents many features of Unicorn
# that may not be needed for some applications. See
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
# for a much simpler configuration file.
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
@christoomey
christoomey / json-vim-config.md
Last active January 4, 2018 18:24
Configuration for better JSON editing in Vim

Install jsonlint to act as syntastic json checker:

$ npm install jsonlint -g

Tell syntatastic about it:

" in your ~/.vimrc

==========

A useful tools or tips list for mobile web application developing

这个项目收集移动端开发所需要的一些资源与小技巧

一些非常重要的工具类网站

@ThomasBurleson
ThomasBurleson / PeopleListControllerSpec.js
Last active August 8, 2018 15:24
When using Karma, RequireJS, and AngularJS... demonstrate how Promise(s) callbacks are not auto-triggered when testing with Karma/Jasmine tests. Here we use a Controller and PeopleService with an API that returns Promises. While our mock service resolves the promise, we did that in the context of our test which is `outside` the AngularJS world. …
(function( describe ){
"use strict";
/**
* Demonstration of how to properly use Jasmine testing with AngularJS promise-based services.
*
* NOTE: based on the origina version from Jim Lavin's
* http://codingsmackdown.tv/blog/2012/12/28/mocking-promises-in-unit-tests/
*
* FIXED: Igor Minar fixed this on 8/22/2013. Check with v1.2.x master branch of AngularJS
@whiteinge
whiteinge / rxjs-spinner-poc.js
Created March 2, 2016 05:56
Render a spinner while waiting for an ajax response using RxJS
// Central xhr progress tracker. Used for both a global
// activity indicator as well as granular spinners within in a page.
var Progress$ = new Rx.Subject();
// Make an xhr call and make a tag to track the progress ticks.
var users$ = Rx.DOM.ajax({
method: 'GET',
url: 'https://api.github.com/users',
responseType: 'json',
progressObserver: Rx.Observer.create(