Skip to content

Instantly share code, notes, and snippets.

View mamboer's full-sized avatar

Levin Van mamboer

View GitHub Profile
@mamboer
mamboer / git-bash-ls-chinese-sucks
Created March 18, 2014 06:52
git bash ls命令显示中文乱码的解决办法
git bash ls命令显示中文乱码,
1,在根目录下c:\Users\xxx 下面新建一个.bashrc文件和.bash_aliases文件
2,打开bashrc文件里面加入~/.bash_aliases
3,在bash_aliases文件中加入alias ls='ls --show-control-chars --color=auto'
@mamboer
mamboer / git.config
Last active December 17, 2015 22:29 — forked from NickJosevski/git.config
## .gitconfig
[alias]
dt = difftool
mt = mergetool
[diff]
tool = bc3
[difftool]
prompt = false
[difftool "bc3"]
/*=====日历控件=========*/
.calendar2{*width:536px;}
.calendar1{*width:268px;}
.calendar{
border: 1px solid #e1e1e1;
background-color: #ffffff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
@mamboer
mamboer / sync-master-to-gh-pages.txt
Created November 29, 2013 08:24
easily sync your master to GitHub Pages
GitHub tip: easily sync your master to GitHub Pages
On the occasion that you’re working on a web-related project using GitHub, you may want to simply mirror your demo pages or entire master branch over to the Github Pages for your project to make them web-accessible. An example case for this would be the development of a JavaScript tool that includes an “examples/” section. It would be most convenient to just let people browse that as a webpage from GitHub, keeping it up to date every time the master branch changes.
GitHub Pages make it possible to serve web content from a branch of your repository, and the automatic page generator is very nice. To make it work in the example above, though, an update to both the base repository and the website requires at least:
git checkout master
git status
git commit -am "Committing changes to master"
git push origin master
@mamboer
mamboer / dabblet.css
Created June 29, 2017 06:57 — forked from oli/dabblet.css
Using calc(), rem & vw for scalable rem-based layout
/* Using calc(), rem & vw for scalable rem-based layout */
/* ref http://dev.w3.org/csswg/css3-values/#calc0 example 13 */
/* waiting for vw support */
body {margin: 0; text-align: center;}
.wrapper {
width: 40rem;
margin: 2em auto;
border-bottom: 2px solid #ccc;
}
.content {
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Caliburn.Micro;
using Autofac;
using IContainer = Autofac.IContainer;
namespace Caliburn.Micro.Autofac {
@ChiChou
ChiChou / DeviceOrientationController.js
Last active September 10, 2017 02:03
Improved DeviceOrientationController for THREE.js, forked from threeVR
/**
* -------
* threeVR (https://github.com/richtr/threeVR)
* -------
*
* W3C Device Orientation control (http://www.w3.org/TR/orientation-event/)
* with manual user drag (rotate) and pinch (zoom) override handling
*
* Author: Rich Tibbett (http://github.com/richtr)
* License: The MIT License
@billynyh
billynyh / VerticalScrollView.js
Created August 25, 2012 03:16
Using horizontal viewpager inside vertical scrollview
//http://stackoverflow.com/questions/2646028/android-horizontalscrollview-within-scrollview-touch-handling
public class VerticalScrollView extends ScrollView {
private float xDistance, yDistance, lastX, lastY;
public VerticalScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
@laaptu
laaptu / CustomScrollView
Created September 5, 2013 08:03
Android View Pager or Horizontal Scroll View/List inside a vertical ScrollView http://stackoverflow.com/questions/2646028/android-horizontalscrollview-within-scrollview-touch-handling
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ScrollView;
public class VerticalScrollView extends ScrollView {
public VerticalScrollView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@bradwilson
bradwilson / gist:2417226
Created April 18, 2012 22:55
Ninject dependency resolver for Web API
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Web.Http.Dependencies;
using Ninject;
using Ninject.Syntax;
public class NinjectDependencyScope : IDependencyScope
{
private IResolutionRoot resolver;