Skip to content

Instantly share code, notes, and snippets.

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

Vi iissnan

💭
I may be slow to respond.
View GitHub Profile
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
@iissnan
iissnan / re_email.js
Created January 22, 2013 08:23
Pattern for email adress
/[-\w\.]+@(?:[a-zA-Z0-9]+\.)*[a-zA-Z0-9]+/
@iissnan
iissnan / collasping-margin-tester.html
Created March 12, 2013 03:31
margin折叠测试题
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>margin折叠测试题</title>
</head>
<body>
<h1>margin折叠测试题</h1>
<ul>
@iissnan
iissnan / aobject.php
Created April 1, 2013 07:50
Create a object in PHP without a class
<?php
$user = (object) array("name" => "vin", "title" => "unkown");
echo $user->name; //vin
echo $user->title; //unkown
@iissnan
iissnan / grayscale.css
Created April 20, 2013 16:27
页面全灰
html {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
zoom: 1;
}
{
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
@iissnan
iissnan / sgs.css
Created December 8, 2013 15:32
Stylebot Global StyleSheet
@import url("http://fonts.googleapis.com/css?family=Roboto+Slab");
/*@import url("http://fonts.googleapis.com/css?family=Droid+Serif");*/
@import url("http://fonts.googleapis.com/css?family=Droid+Sans:400,700");
@import url("http://fonts.googleapis.com/css?family=Droid+Sans+Mono");
body, p, td {
font-family: "Droid Sans", Calibri, "Lucida Grande", sans-serif;
@iissnan
iissnan / update_submodule.md
Last active December 30, 2015 21:29
Update git submodule.

You can use git submodule foreach to handle a batch of submodules:

git submodule foreach git pull origin master

Or, update submodule one by one:

# go to submodule directory and update to latest.
| Left align | Right align | Center align |
|:-----------|------------:|:------------:|
| This       |        This |     This     
| column     |      column |    column    
| will       |        will |     will     
| be         |          be |      be      
| left       |       right |    center    
| aligned    |     aligned |   aligned
Function Defines
provider(name, Object OR constructor()) A configurable service with complex creation logic. If you pass an Object, it should have a function named $get that returns an instance of the service. Otherwise, Angular assumes you’ve passed a constructor that, when called, creates the instance.
factory(name, $get Function()) A non-configurable service with complex creation logic. You specify a function that, when called, returns the service instance. You could think of this as provider(name, { $get: $getFunction() } ).
service(name, constructor()) A non-configurable service with simple creation logic. Like the constructor option with provider, Angular calls it to create the service instance.