Skip to content

Instantly share code, notes, and snippets.

View dmyers's full-sized avatar

Derek Myers dmyers

View GitHub Profile
@andyrbell
andyrbell / scanner.sh
Last active March 28, 2025 17:57
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 6, 2025 10:26
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@ajinux
ajinux / README.md
Last active September 27, 2023 21:39
This python script scrapes the fedex website and outputs the package details on giving the package tracking id as input

FEDEX SCRAPER

Question

Question Code:FEDEX
                    Write a Python script which will scrape the FEDEX website to obtain the tracking details of the given shipment tracking details. The output by the script should be in JSON format.
Input: 744668909687
Expected Output:
{ "tracking no": 744668909687,
"ship date": "Wed 19/07/2017",
"status": "delivered",
"scheduled delivery": "Mon 24/07/2017 16:21"

#!/usr/bin/ruby
#
# This tool is only used to "decrypt" the github enterprise source code.
#
# Run in the /data directory of the instance.
require "zlib"
require "byebug"
KEY = "This obfuscation is intended to discourage GitHub Enterprise customers "+
@runes83
runes83 / Swagger
Last active February 26, 2020 09:48
Swagger json
{
"swagger": "2.0",
"info": {
"version": "v1",
"title": "IdentiSign Identify",
"description": "This API enables authentication/identification through mutliple identityprvoiders such as Norwegian BankID, Swedish BankID, Nemid, etc.\r\n \r\n # Introduction\r\n This API is documented in **OpenAPI format** and is based on\r\n [Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\r\n It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\r\n tool and [ReDoc](https://github.com/Rebilly/ReDoc) documentation. In addition to standard\r\n OpenAPI syntax we use a few [vendor extensions](https://github.com/Rebilly/ReDoc/blob/master/docs/redoc-vendor-extensions.md).\r\n\r\n # OpenAPI Specification\r\n
// manual configuration for the spacer plugin in:
// https://github.com/aldryn/aldryn-bootstrap3/
// requires bootstrap 3
.spacer {
margin-top: $line-height-computed;
margin-bottom: $line-height-computed;
}
.spacer-xs {
margin-top: $line-height-computed / 2;
@sn3p
sn3p / index.html
Last active May 18, 2019 05:50
Gist for blog post "Customizing the Intercom Launcher" http://blog.learningspaces.io/customizing-the-intercom-launcher
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Inject a stylesheet into the iframe</title>
<link rel="stylesheet" href="intercom.css">
</head>
<script>
// IMPORTANT: Make sure to change YOUR_APP_ID
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true; s.src='https://widget.intercom.io/widget/YOUR_APP_ID'; var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()
@zthomas
zthomas / intercom-delete-old-users.js
Last active May 1, 2023 15:28
Script to delete and clear old users from intercom. Useful for lowering the monthly bill
// License: MIT, feel free to use it!
const Intercom = require('intercom-client');
const appId = 'APP_ID'
const apiKey = 'APP_KEY'
const client = new Intercom.Client(appId, apiKey);
const async = require('async-q')
//REF: https://developers.intercom.com/reference#iterating-over-all-users
//WARNING: you can only have one scroll working at once. you need to wait for that scroll to clear to try again
anonymous
anonymous / .gitlab-ci.yml
Created August 17, 2016 15:46
---
image: php:5.6
stages:
- test_build
- test
- dist_build
- deploy
before_script:
@robsonke
robsonke / checkDockerDisks.sh
Last active September 30, 2024 09:34
This Bash script will loop through all running docker containers on a host and list the disk usage per mount. In case it's breaching the 65%, it will email you.
#!/bin/bash
# get all running docker container names
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}')
host=$(hostname)
# loop through all containers
for container in $containers
do
echo "Container: $container"