Skip to content

Instantly share code, notes, and snippets.

View xiaoyvr's full-sized avatar

Yu Xiaoqiang xiaoyvr

  • ThoughtWorks
  • Dallas
View GitHub Profile
// step0: quick intro about paket, fake, |> operator and unit
// ------------------ begin ----------------
(*
The problem: lots of boilerplate code to make sure the exit code is being handled properly in our build script.
when we have more steps, the code will smell worse.
*)
@xiaoyvr
xiaoyvr / stash_dropped.md
Created February 10, 2022 00:01 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

# goto the folder
zip -X0 xxx.epub mimetype
zip -rDX9 xxx.epub * -x "*.DS_Store" -x mimetype
echo "01 ±±" | iconv -f UTF-8-Mac -t latin1 | iconv -f gb2312
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
curl -LI mazgi.com -o /dev/null -w '%{http_code}\n' -s
($ctx = $executioncontext.gettype().getfield("_context","nonpublic,instance").getvalue( $executioncontext)).gettype().getfield("_authorizationManager","nonpublic,instance").setvalue($ctx, (new-object System.Management.Automation.AuthorizationManager "Microsoft.PowerShell"))
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace MyNamespace
using System;
using System.Data;
using Newtonsoft.Json;
using NHibernate;
using NHibernate.SqlTypes;
using NHibernate.UserTypes;
namespace SomeNamespace
{
[Serializable]
const _ = require('lodash')
const Ajv = require('ajv')
const pathToRegexp = require('path-to-regexp')
const {expect} = require('chai')
const SwaggerParser = require('swagger-parser')
const request = require('supertest')
module.exports = {
create: async(specFile) => {
const parser = new SwaggerParser()