Skip to content

Instantly share code, notes, and snippets.

View jschneid's full-sized avatar
🙂
Coding

Jon Schneider jschneid

🙂
Coding
View GitHub Profile
@fasiha
fasiha / no-hackerrank.md
Last active August 7, 2023 11:47
A prospective employer invited me to do a HackerRank test. Here's my proposed alternative.

Well, that was unexpected. In the following, I’m trying to follow Jon Evans’ advice from “The Terrible Technical Interview”.


To: recruitment@EmployerABC.com
From: Ahmed Fasih
Subject: Re: Programming Test Invitation

Hi there! Thanks for offering to let me take a HackerRank test for ABC, I appreciate the vote of confidence.

@Glideh
Glideh / listSubviewsOfView.m
Last active May 25, 2022 02:36
Lists views recursively with indentation for subviews
- (void)listSubviewsOfView:(UIView *)view {
[self listSubviewsOfView:(UIView *)view withPrefix:@""];
}
- (void)listSubviewsOfView:(UIView *)view withPrefix:(NSString *)prefix {
NSArray *subviews = [view subviews];
for (UIView *subview in subviews) {
NSLog(@"%@ %@ (%d %d; %d %d)", prefix, subview.class
, (int)subview.frame.origin.x
, (int)subview.frame.origin.y
, (int)subview.frame.size.width
@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active October 3, 2024 14:52
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

@TomLiu
TomLiu / NSImage+ScreenShot.h
Created November 25, 2013 03:29
Get main screen shot as NSImage
//
// NSImage+ScreenShot.h
// YunPan for Mac
//
// Created by 61 on 13-11-25.
//
//
#import <Cocoa/Cocoa.h>
@jogleasonjr
jogleasonjr / SlackClient.cs
Last active October 20, 2023 15:54
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{
@mudrd8mz
mudrd8mz / gist:2828474
Created May 29, 2012 13:49
Git pre-commit hook that does not allow committing a change containing DONOTCOMMIT text
$ cat .git/hooks/pre-commit
#!/bin/bash
FOUND=$(git diff-index --cached -U0 HEAD -- | grep DONOTCOMMIT | wc -l)
if [[ $FOUND -gt 0 ]]; then
echo "pre-commit hook: DONOTCOMMIT detected, commit not allowed"
exit 1
fi