Skip to content

Instantly share code, notes, and snippets.

#---------------------------------------------------#
## 配置文件需要放置在 $HOME/.config/clash/config.yml
##
## 如果您不知道如何操作,请参阅 SS-Rule-Snippet 的 Wiki:
## https://github.com/Hackl0us/SS-Rule-Snippet/wiki/clash(X)
#---------------------------------------------------#
# HTTP 代理端口
port: 7890
@Michaelmilk
Michaelmilk / ParseSample.java
Created August 13, 2019 09:13 — forked from marcel-dias/ParseSample.java
SnakeYAML Parse Example
package com.marceldias.mars.yaml;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import org.yaml.snakeyaml.TypeDescription;
import org.yaml.snakeyaml.Yaml;
@Michaelmilk
Michaelmilk / JS-LINQ.js
Created May 24, 2018 09:45 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
@Michaelmilk
Michaelmilk / JsonPath.cs
Created June 16, 2017 03:22 — forked from atifaziz/JsonPath.cs
C# implementation of JSONPath (v0.5.1)
//
// C# implementation of JSONPath[1]
//
// Copyright (c) 2007 Atif Aziz (http://www.raboof.com/)
// Licensed under The MIT License
//
// Supported targets:
//
// - Mono 1.1 or later
// - Microsoft .NET Framework 1.0 or later
@Michaelmilk
Michaelmilk / BookController.cs
Created October 18, 2016 01:32 — forked from jayhjkwon/BookController.cs
WebAPI2 Unit Testing with IHttpActionResult
// GET api/books
public IHttpActionResult Get()
{
return Ok(_repository.GetBooks().AsEnumerable());
}
// GET api/books/1
public IHttpActionResult Get(int id)
{
var book = _repository.GetBook(id);
@Michaelmilk
Michaelmilk / nav-wizard.bootstrap.css
Created September 28, 2016 13:06 — forked from bjcull/nav-wizard.bootstrap.css
Wizard style navigation tabs for bootstrap
.nav-pills.nav-wizard > li {
position: relative;
overflow: visible;
border-right: 15px solid transparent;
border-left: 15px solid transparent;
}
.nav-pills.nav-wizard > li + li {
margin-left: 0;
}
.nav-pills.nav-wizard > li:first-child {
@Michaelmilk
Michaelmilk / draggable.js
Created July 6, 2016 11:12 — forked from siongui/draggable.js
AngularJS draggable element (position must be absolute)
/**
* @see https://github.com/siongui/palidictionary/blob/master/static/js/draggable.js
* @see http://docs.angularjs.org/guide/compiler
*/
angular.module('draggableModule', []).
directive('draggable', ['$document' , function($document) {
return {
restrict: 'A',
link: function(scope, elm, attrs) {
@Michaelmilk
Michaelmilk / typescript_angular.adoc
Created June 15, 2016 12:27 — forked from esfand/typescript_angular.adoc
AngularJS with TypeScript
@Michaelmilk
Michaelmilk / Node.js File Looper
Created May 30, 2016 09:52 — forked from adamwdraper/Node.js File Looper
Loop through all files in a given directory with node.js
var fs = require('fs');
var walkPath = './';
var walk = function (dir, done) {
fs.readdir(dir, function (error, list) {
if (error) {
return done(error);
}
@Michaelmilk
Michaelmilk / FileAttachmentController.cs
Created May 24, 2016 03:03 — forked from joeriks/FileAttachmentController.cs
Use webapi to download file as attachment (using AttributeRouting)
[RoutePrefix("files")]
public class FilesController : ApiController
{
[GET("somepdf/{id}")]
public HttpResponseMessage GetSomePdf(string id)
{
var path = MyApp.PathToSomePdf(id);
if (path!= null)
return FileAsAttachment(path, "somepdf.pdf");