Skip to content

Instantly share code, notes, and snippets.

@mcenirm
mcenirm / Find_distribution_groups_for_recipient.ps1
Last active June 24, 2018 19:19
Assorted Powershell scriptlets to remember...
$alias = 'jdoe'
$recipient = Get-Recipient $alias
$dn = $recipient.DistinguishedName
$filter = "Members -like ""$dn"""
Get-DistributionGroup -Filter $filter
<# Results:
Name DisplayName GroupType PrimarySmtpAddress
---- ----------- --------- ------------------
Staff Staff Universal, SecurityEnabled staff@example.com
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep -B6 bindings:.*:
@CNG
CNG / gist:edd8f6210caede7a7f8e
Created June 16, 2014 06:16
Japanese katakana and hiragana in plain text
Katakana Codes
ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶヷヸヹヺ・
Punctuation and Symbols
゛゜ーヽヾ
Phonetic Extensions for Ainu
ㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ
Circle Forms
@auser
auser / app.js
Last active January 26, 2021 01:59
angular.module('myApp',
['ngRoute', 'myApp.services', 'myApp.directives']
)
.config(function(AWSServiceProvider) {
AWSServiceProvider.setArn('arn:aws:iam::<ACCOUNT_ID>:role/google-web-role');
})
.config(function(StripeServiceProvider) {
StripeServiceProvider.setPublishableKey('pk_test_YOURKEY');
})
.config(function($routeProvider) {
@chilicat
chilicat / docker
Last active December 26, 2015 08:19
Docker centos/rhel service init script
!/bin/bash
### BEGIN INIT INFO
# INIT INFO
# Provides: docker
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: docker
@JohnathanMarkSmith
JohnathanMarkSmith / MirroringaGitrepostory.txt
Last active December 16, 2015 15:19
Mirroring a Git repostory
Mirroring a Git repostory
The firm I recently stated working at just moved to Git and I am the only resource then knows Git. I get asked so many times a day on how to mirror a git repostory.
From the birds eyes very its very easy:
git clone --mirror git@git.com:project project
cd project
git remote add github git@github.com:username/project.git
@mbostock
mbostock / .block
Last active April 27, 2023 07:09 — forked from mbostock/.block
Polar Azimuthal Equal-area
license: gpl-3.0
redirect: https://beta.observablehq.com/@mbostock/d3-azimuthal-equal-area
@hay
hay / gist:1351230
Last active March 29, 2024 16:36
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Enterprisify your Java Class Names! (by Hay Kranen)</title>
<style>
body {
background: white;
text-align: center;
@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()