Skip to content

Instantly share code, notes, and snippets.

View xiongxin's full-sized avatar
:bowtie:
Let It Go

熊鑫 xiongxin

:bowtie:
Let It Go
View GitHub Profile
@xiongxin
xiongxin / bs.dart
Last active October 9, 2019 18:52
Angular Dart ViewChild ContentChild example
import 'dart:html';
import 'package:angular/angular.dart';
import 'package:angular_forms/angular_forms.dart';
@Component(
selector: 'child-directive',
template: '<p>child</p>'
)
@xiongxin
xiongxin / list.html
Last active August 9, 2016 03:41
列表分页前端代码
<!DOCTYPE html>
<html lang="zh-CN"><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{$name} - 百合花俱乐部</title>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width">
<meta content="telephone=no" name="format-detection">
<link href="{MAIQUAN_LILY_STATIC}style/reset.css" rel="stylesheet">
<link href="{MAIQUAN_LILY_STATIC}style/main.css" rel="stylesheet">
<link href="{MAIQUAN_LILY_STATIC}style/weui.css" rel="stylesheet">
@xiongxin
xiongxin / client.nim
Created February 25, 2016 13:10
nim sockets
import net
import rawsockets
import strutils
const SERVER_PORT = Port(1987)
const SERVER_ADDR = "localhost"
var canQuit = false
proc main() =
@xiongxin
xiongxin / metadata.dart
Last active October 26, 2015 07:58
Retrieve metadata in Dartlang
// Dart VM version: 1.13.0-dev.7.3 (Fri Oct 23 04:20:51 2015) on "windows_x64"
// https://www.dartlang.org/docs/dart-up-and-running/ch03.html#dartmirrors---reflection
// http://stackoverflow.com/questions/19492607/how-to-retrieve-metadata-in-dartlang
import 'dart:mirrors';
class todo {
final String who;
final String what;
const todo(this.who, this.what);
@xiongxin
xiongxin / war.exs
Last active August 29, 2015 14:10 — forked from MonkeyIsNull/war.exs
defmodule Die do
def init(), do: :random.seed(:erlang.now)
def d6(), do: :random.uniform(6)
def d100(), do: :random.uniform(100)
end
defmodule War do
def create_player(name, skill, hp) do
[ name: name, skill: skill, hp: hp ]
end
@xiongxin
xiongxin / curd.ex
Last active August 29, 2015 14:08
elixir phoenix curd模板文件
defmodule PhoenixJobs.JobController do
use Phoenix.Controller
alias PhoenixJobs.Repo
alias Phoenix.Controller.Flash
alias PhoenixJobs.Queries
alias PhoenixJobs.Router.Helpers
plug :action
def index(conn, _params) do
@xiongxin
xiongxin / routes.ex
Last active August 29, 2015 14:02
rails routes with admin for posts
resources "/posts",only: [:show]
scpco "/admin" do
resources "/posts",except: [:show]
end