Skip to content

Instantly share code, notes, and snippets.

@hahalin
hahalin / buddha.txt
Created August 20, 2021 00:57 — forked from Jian-Min-Huang/buddha.txt
Buddha Ascii Art
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
// | | \\\ - /// | |
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
@hahalin
hahalin / aspnetmvc-view-ng-select-default-value.cshtml
Created March 6, 2016 14:24
asp.net mvc view angularjs select tag
<select ng-model="selectedCompany"
ng-init="selectedCompany='2'"
class="form-control" ng-options="c.id as c.nm for c in companies ">
</select>
@hahalin
hahalin / angular-select-data-controller.js
Last active March 6, 2016 14:22
angularjs populate select option data from ajax
var app = angular.module('BpmApp', [])
app.controller('regctrl', function ($scope, CompanyService) {
getCompanies();
$scope.selectedCompany = "1";
function getCompanies() {
CompanyService.getCompanies()
.success(function (ds) {
<ul>
@foreach (var department in Model)
{
<li> @Html.ActionLink(
department.departmentName,
"Detail",
"Department",
new { id = department.id },
new { target = "_blank" }
@hahalin
hahalin / mvc03-2.cs
Last active September 20, 2015 13:23
public ActionResult Contact()
{
ViewBag.Message = "與我們聯絡";
List<department> departmentlist = new List<department>();
department depobj = new department();
depobj.id = "a001"; depobj.departmentName = "業務部";
departmentlist.Add(depobj);
depobj = new department();
depobj.id = "a002"; depobj.departmentName = "創意部";
@hahalin
hahalin / mvc03-1.cs
Last active September 20, 2015 13:14
public class department
{
public string id { get; set; }
public string departmentName { get; set; }
}
<ul>
@foreach (string item in (List<string>)ViewBag.DepartmentList)
{
<li>@item</li>
}
</li>
</ul>
public ActionResult Contact()
{
ViewBag.Message = "與我們聯絡";
List<string> DepartmentList = new List<string>();
DepartmentList.Add("業務部");
DepartmentList.Add("創意部");
DepartmentList.Add("行銷部");
ViewBag.DepartmentList = DepartmentList;
CREATE TABLE [dbo].[category](
[id] [int] NOT NULL,
[cname] [varchar](20) NULL,
PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]