Skip to content

Instantly share code, notes, and snippets.

Pedro Paulo Jr ppaulojr

Block or report user

Report or block ppaulojr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@notbanker
notbanker / stockfish.sh
Last active Mar 5, 2017
Use stockfish engine to output the position evaluation only
View stockfish.sh
#!/usr/bin/env bash
# Call stockfish engine on mac and return only the evaluation score
# Usage stockfish.sh 'r1b2rk1/4qppp/2pp4/pp6/3Bn3/PB3Q1P/1PP2PP1/3R1RK1' 5 mac 12 1024
# Usage stockfish.sh 'r1b2rk1/4qppp/2pp4/pp6/3Bn3/PB3Q1P/1PP2PP1/3R1RK1' 5 mac 12 1024
# Assumes the stockfish binary is called 'stockfish_'+binary
fen=$1
seconds=${2:-3}
binary=${3:-mac}
threads=${4:-12}
@benvium
benvium / MyTabBar.m
Created Mar 5, 2015
UITabBarController slide animation. Slide left and right when tabs are selected. Based on code from StackOverflow (linked in code)
View MyTabBar.m
- (BOOL) tabBarController:(UITabBarController *)tabBarController
shouldSelectViewController:(UIViewController *)viewController {
// http://stackoverflow.com/questions/5161730/iphone-how-to-switch-tabs-with-an-animation
NSUInteger controllerIndex = [self.viewControllers indexOfObject:viewController];
if (controllerIndex == tabBarController.selectedIndex) {
return NO;
}
@ept
ept / gist:4475995
Last active May 19, 2019
Syntax highlighting code for PowerPoint (Mac OS)
View gist:4475995

How to add syntax-highlighted code to PowerPoint slides (Mac OS)

  1. pygmentize -f rtf FILE | pbcopy
  2. Paste into TextEdit (in rich text mode: Format → Make Rich Text before pasting), and copy to clipboard again.
  3. In PowerPoint, Edit → Paste Special… → Styled Text.

(Pasting RTF directly into PowerPoint doesn't work correctly, at least with PowerPoint 2008 — it extends colour spans longer than it should, and sometimes removes line breaks. Going via TextEdit seems to solve the problem.)

You can’t perform that action at this time.