- Update the index of packages
$ sudo apt update- Update (upgrade) installed packages
$ sudo apt upgrade| # See https://stackoverflow.com/questions/48341920/git-branch-command-behaves-like-less | |
| git config --global pager.branch false |
| // See https://codepen.io/dhavalt10/pen/rGLBzB | |
| history.pushState(null, null, location.href); | |
| window.onpopstate = function () { | |
| history.go(1); | |
| }; |
| $.fn.serializeObject = function () { | |
| var i, len, item, object = {}, array = $(this).serializeArray() || []; | |
| len = array.length; | |
| for (i = 0; i < len; i += 1) { | |
| item = array[i]; | |
| object[item.name] = item.value; | |
| } | |
| return object; | |
| } |
| public class ReportPrinter : IDisposable | |
| { | |
| private int currentPageIndex; | |
| private IList<Stream> streams; | |
| private DataTable LoadSalesData() | |
| { | |
| // Create a new DataSet and read sales data file | |
| // data.xml into the first DataTable. | |
| DataSet dataSet = new DataSet(); |
| // See https://github.com/elastic/elasticsearch-net/issues/2860 | |
| public class MyDocument | |
| { | |
| public string RecordType { get; set; } | |
| } | |
| var client = new ElasticClient(); | |
| client.Search<MyDocument>(s => s |
| Stop-Service DiagTrack | |
| Set-Service DiagTrack -StartupType Disabled |
| /// See https://stackoverflow.com/questions/11143303/how-to-set-author-name-to-excel-file-using-poi | |
| public static void SetAuthor(this IWorkbook workbook, string author) | |
| { | |
| if (workbook is NPOI.XSSF.UserModel.XSSFWorkbook) | |
| { | |
| var xssfWorkbook = workbook as NPOI.XSSF.UserModel.XSSFWorkbook; | |
| var xmlProps = xssfWorkbook.GetProperties(); | |
| var coreProps = xmlProps.CoreProperties; | |
| coreProps.Creator = author; | |
| return; |
| internal class Helpers | |
| { | |
| internal string GetCallingMethodName() | |
| { | |
| string result = "unknown"; | |
| StackTrace trace = new StackTrace(false); | |
| for (int i = 0; i < trace.FrameCount; i++) | |
| { | |
| StackFrame frame = trace.GetFrame(i); | |
| MethodBase method = frame.GetMethod(); |
| slmgr.vbs -upk |