Skip to content

Instantly share code, notes, and snippets.

@streeter
streeter / get_channels.js
Created March 25, 2022 00:59 — forked from felixrieseberg/get_channels.js
Slack: Get a list of your channels (excluding DMs, group chats, and archived/private channels)
// Open up the Slack Developer Tools by entering "/slackdevtools"
// in the message input.
// First, run this. The client will reload.
slackDebug.enable()
// Then, get channels. See "filterChannels" to remove channels
// beginning with a certain prefix.
(function getMyChannels() {
const allChannels = slackDebug.storeInstance.getStateByTeamId(slackDebug.activeTeamId).channels.__proto__
@streeter
streeter / intensify.sh
Created February 25, 2022 18:51 — forked from leosunmo/intensify.sh
intensifies Slack emoji creator
#!/bin/bash
# Generate a `:something-intensifies:` Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
if ! command -v identify &> /dev/null
then
if [ "$(uname)" == "Darwin" ]; then
@streeter
streeter / EmojiPointersDemo.swift
Created September 19, 2018 17:13 — forked from cellularmitosis/EmojiPointersDemo.swift
Representing pointer values as emoji can be useful for "visually" debugging certain issues, like cell reuse, etc.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
@streeter
streeter / DropboxIgnore.md
Created March 5, 2018 18:55 — forked from idleberg/DropboxIgnore.md
Ignore node_modules/bower_components folders in your Dropbox

This script scans your Dropbox (or any given folder) for folders stored in the ignore array and excludes them from syncing. Makes use of the official Dropbox CLI

I'm a beginner at bash, so all improvements are welcome!

#!/bin/bash

set -e

# SETTINGS
@streeter
streeter / FCPrivateBatteryStatus.m
Created March 14, 2016 22:31
How to get raw battery info (mAh remaining, etc.) from iOS using private APIs. For internal testing only, NOT APP STORE DISTRIBUTION!
#import <Foundation/Foundation.h>
#include <dlfcn.h>
NSDictionary *FCPrivateBatteryStatus()
{
static mach_port_t *s_kIOMasterPortDefault;
static kern_return_t (*s_IORegistryEntryCreateCFProperties)(mach_port_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, UInt32 options);
static mach_port_t (*s_IOServiceGetMatchingService)(mach_port_t masterPort, CFDictionaryRef matching CF_RELEASES_ARGUMENT);
static CFMutableDictionaryRef (*s_IOServiceMatching)(const char *name);
@streeter
streeter / pelican_deployer.py
Created March 10, 2016 17:37 — forked from marksteve/pelican_deployer.py
Push-to-deploy static sites with Pelican, Flask and Github
"""
Simple web server that listens for Github webhooks to implement push-to-deploy
with Pelican static sites
Settings are loaded from a json file except for SECRET which should be an
environment variable
Example `deployer.json`
{
@streeter
streeter / heroku-nginx-logging.md
Created February 9, 2016 14:56 — forked from simonw/heroku-nginx-logging.md
How to get Heroku to log full user_agent strings using nginx

How to get Heroku to log full user_agent strings using nginx

Heroku's default logging format omits user agent and referrer strings - but these are useful to have! Especially if you want to be able to run your own analysis on what kind of browsers are using your service.

A default Heroku log line looks like this:

heroku/router:  at=info method=GET path="/page-on-your-site/"

host=your-site.herokuapp.com

#!/usr/bin/env python
from sentry.utils.runner import configure
configure(config_path='sentry.conf.py')
from datetime import datetime, timedelta
from sentry.app import tsdb
def cleanup_connection(connection, epoch):
def delete(key):

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.