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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"

A commit is REQUIRED to notify GitHub to create gh-pages for the forked repository.

@iissnan
iissnan / connection_windows_ubuntu.md
Last active December 31, 2015 11:39
Connect from Windows(Host) to Ubuntu(VMWare Machine) via SSH.

Install openssh-server in ubuntu:

sudo apt-get install openssh-server

then, connect with putty via SSH in windows.

angular.module("testModule", [])
// syntax: module.directive("namespaceName", factory)
// factory will be invoked once by $compiler to create a directive for the first time match happens
// and invoked via $inject.invoke makes it injectable just like a controller.
.directive("testDirective", function directiveFactory($log) {
var directiveDefinitionObject = {};
return directiveDefinitionObject;
// or return a constructor function
@iissnan
iissnan / snake.js
Created January 6, 2014 06:05
Snake Game
// MAP INFO
MAP_WIDTH = 300;
MAP_HEIGHT = 300;
MAP_BORDER = 0;
PORTRAIT_DIMENSION = 30;
LANDSCAPE_DIMENSION = 30;
CELL_WIDTH = MAP_WIDTH / PORTRAIT_DIMENSION;
CELL_HEIGTH = MAP_HEIGHT / LANDSCAPE_DIMENSION;
// CANVAS_INFO
@iissnan
iissnan / ubuntu-ssh-server.md
Last active January 2, 2016 11:09
Enable SSH in Ubuntu.

###Install SSH server on ubuntu


  1. Open terminal: ctrl + alt + t

  2. Install SSH Server:

    sudo apt-get install openssh-server
    
@iissnan
iissnan / ubuntu-configurations.md
Last active January 3, 2016 00:49
configuration for unbuntu. Steps executed in Ubuntu 12.04 Desktop LTS.

Using Gnome-shell instead of Unity

  1. Add PPA

    sudo add-apt-repository ppa:gnome3-team/gnome3
    sudo add-apt-repository ppa:ricotz/testing
    
  2. Install the Gnome-shell

@iissnan
iissnan / gist:8396337
Last active January 3, 2016 02:29 — forked from novnan/gist:8395486
// 有近百名学生选修了某们课程,他们来源不同的专业班级,按班级,学号顺序打印学生的班级名称,学号和姓名。
#include <stdio.h>
#include <string.h>
#define N 5
#define LENGTH 10
char sName[N][LENGTH], sID[N][LENGTH], sClass[N][LENGTH];
void s();
@iissnan
iissnan / main.css
Created April 28, 2014 02:16
Styles for epub books.
body {
padding: 0;
margin: 0 1%;
line-height: 1.5;
text-align: justify;
}
div {
margin: 0px;
padding: 0px;
}