Skip to content

Instantly share code, notes, and snippets.

Avatar

Mohammad Dashti mdashti

View GitHub Profile
@mdashti
mdashti / stacktrace.cxx
Created Jun 10, 2021 — forked from fmela/stacktrace.cxx
A C++ function that produces a stack backtrace with demangled function & method names.
View stacktrace.cxx
/*
* Copyright (c) 2009-2017, Farooq Mela
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
View Useful Commands
# use this command to split a file into multiple pages
gsplit -l 7100 -d lineitem.tbl lineitem.tbl.part
@mdashti
mdashti / git_extraction.md
Last active Oct 30, 2017 — forked from jamesarosen/git_extraction.md
Extracting a directory from a git project
View git_extraction.md

Recently, I needed to extract a number of directories from a git project each into their own projects. The original directory structure looked like

project/
  subprojects/
    Foo/
    Bar/
    Baz
@mdashti
mdashti / gist:2007c6663d055792e509
Last active Mar 18, 2020
Bash script for git pull using username and password
View gist:2007c6663d055792e509
#!/bin/bash
path="/var/www/sites/htdocs/wp-content/themes/vip/";
git_path="https://username:password@mdashti.com/DBToaster/";
git_array=( plugins pmc-variety pmc-plugins );
git_path_array=("${git_array[@]}")
View gist:a47bd9328bebfa6babdf
package com.example.controller;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;