Skip to content

Instantly share code, notes, and snippets.

@mjtworks
mjtworks / Doxyfile
Created November 28, 2015 10:23 — forked from dimitarcl/Doxyfile
Documenting JavaScript with Doxygen
FILTER_PATTERNS =*.js=doxygen.js
@mjtworks
mjtworks / location.php
Created December 8, 2015 14:29 — forked from shakhal/location.php
Extracting Your Own Location Information From Google
// Today's time is needed to get the bounding for the request
$currentTime = time();
// Beginning and end of the day
$startTime = strtotime("midnight", $currentTime);
$endTime = strtotime("tomorrow", $startTime);
$smon = date("m", $startTime)-1;
$sday = date("d", $startTime);
$syear = date("Y", $startTime);
@mjtworks
mjtworks / pdf2htmlEX.sh
Created August 16, 2016 20:05 — forked from rajeevkannav/pdf2htmlEX.sh
Install CMake, pkg-config,GNU Getopt,GCC,poppler,fontforge,pdf2htmlEX in Ubuntu 15.05
#!/bin/bash
# Ubuntu Developer Script For pdf2htmlEx
# Created by Rajeev Kannav Sharma
# http://rajeevkannav.github.io/
#
#
# Downloads and configures the following:
#
# CMake, pkg-config
# GNU Getopt
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<style type="text/css">
body{font:12px/1.231 arial,helvetica,clean,sans-serif;}
</style>
@mjtworks
mjtworks / gist:3b17355c6dba6810d4a500a20c91cba7
Created October 15, 2016 04:10 — forked from chrissimpkins/gist:5bf5686bae86b8129bee
Atom Editor Cheat Sheet (Sweetmeat)

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@mjtworks
mjtworks / gist:27772293d82ad5286e6d2b2f047560bb
Created January 26, 2017 05:29 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@mjtworks
mjtworks / PDFExtractor.cs
Created May 20, 2017 15:47 — forked from gyurisc/PDFExtractor.cs
Extracting attachments from a PDF file and write it out to a file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iTextSharp.text.pdf;
namespace PDFExtract
{
public class PDFExtractor
{
@mjtworks
mjtworks / Dockerfile
Created May 29, 2018 19:27 — forked from PurpleBooth/Dockerfile
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
RUN mkdir -p /go/src/github.com/purplebooth/example
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]
@mjtworks
mjtworks / Makefile
Created June 17, 2018 12:44 — forked from turtlemonvh/Makefile
Golang Project Makefile Template
# Borrowed from:
# https://github.com/silven/go-example/blob/master/Makefile
# https://vic.demuzere.be/articles/golang-makefile-crosscompile/
BINARY = superdo
VET_REPORT = vet.report
TEST_REPORT = tests.xml
GOARCH = amd64
VERSION?=?
@mjtworks
mjtworks / read_mitmproxy_dumpfile.py
Created June 21, 2018 12:33 — forked from nderkach/read_mitmproxy_dumpfile.py
Read a mitmproxy dump file and generate a curl command
#!/usr/bin/env python
#
# Simple script showing how to read a mitmproxy dump file
#
### UPD: this feature is now avaiable in mitmproxy: https://github.com/mitmproxy/mitmproxy/pull/619
from libmproxy import flow
import json, sys