Skip to content

Instantly share code, notes, and snippets.

@demmer
demmer / slack-messages-by-user.py
Created December 2, 2016 22:59
count slack messages posted to a channel by user
#!/usr/bin/python
'''
Script to count messages by user posted to a channel for a given date range.
Install:
# sudo pip install slackclient
Also you will need to obtain a slack API token:
https://api.slack.com/docs/oauth-test-tokens
@iversond
iversond / x-OPPRIDLogField
Last active April 1, 2021 20:27
WebLogic HTTP Header to log OPRID for PeopleSoft pages to the access log (from @ripleymj).
import weblogic.servlet.logging.CustomELFLogger;
import weblogic.servlet.logging.FormatStringBuffer;
import weblogic.servlet.logging.HttpAccountingInfo;
import java.lang.reflect.Method;
public class OPRIDLogField implements CustomELFLogger
{
public void logField(HttpAccountingInfo metrics, FormatStringBuffer buff)
{
@robertpainsi
robertpainsi / README.md
Last active March 12, 2026 17:43
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
@lopspower
lopspower / README.md
Last active April 29, 2026 15:47
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@simonc
simonc / Grooveshark Backup.md
Last active March 27, 2019 14:25
Go to grooveshark and type this in the development console (Thank you audiosplitter.fm !!)

Backup for Grooveshark Collection

This works even with Grooveshark dead!

The awesome people at audiosplitter.fm provide a little code snippet that allows you to get your Grooveshark collection back.

Go to http://grooveshark.com and open your browser devtools, go to the Console tab and type the content of the JS script. You'll get a big JSON blob, if you know how to exploit it good for you, if not audiosplitter.fm can import it, go use it ;)

@chrisjohnson00
chrisjohnson00 / testCharacterProgressionPayload
Created January 25, 2013 02:29
Blizzard WOW Character Progression API Payload Test
public function testCharacterProgressionPayload()
{
$payload = $this->getPayloadObject($this->urlArray['CharacterProgression']);
$this->assertInternalType('object', $payload, 'Payload is not an object');
$this->assertObjectHasAttributeOfType('progression', 'object', $payload);
$progression = $payload->progression;
$this->assertObjectHasAttributeOfType('raids', 'array', $progression);
foreach ($progression->raids as $raid)
{
$this->assertInternalType('object', $raid, 'raid is not an object');
<?php
/*
* Podcast URL Extractor
* implemented at http://itunes.so-nik.com
*
* All code has been re-written by lasavior.
* Original code & inspiration from Michael Sitarzewski, zerologic.com
*
* Ex: http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewPodcast?id=269238657
@MrDys
MrDys / gist:3512455
Created August 29, 2012 13:26
Link directly to an open modal window in Bootstrap
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it:
Make sure your modal has an id:
<div class="modal" id="myModal" ... >
Then stick this bit of Javascript at at the end of your document:
*/
$(document).ready(function() {
@jaygooby
jaygooby / git_notes.md
Last active April 29, 2026 15:14
Git, you bloody git

Checkout a stash overwriting the current branch

git checkout stash@{0} -- .

This will potentially overwrite uncommitted files so you may lose work.

Via https://www.vincentschmalbach.com/applying-git-stash-changes-with-force/

Create a git alias to show all your git aliases

git config --global alias.alias "! git config --get-regexp ^alias. | sed -e s/^alias.// -e s/\ /\ =\ /"