This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script is inspired from: https://github.com/kigaita/PsvDecryptCore | |
# It allows you to decrypt psv video files for online developer training website | |
# The original code was written with .NET for Windows users, this one with Python tested for Mac users. | |
# *** Disclaimer **** | |
# Please only use it for your convenience so that you can watch the courses on your devices offline or for educational purposes. | |
# Piracy is strictly prohibited. Decrypted videos should not be uploaded to open servers, torrents, or other methods of mass distribution. Any consequences resulting from misuse of this tool are to be taken by the user. | |
# packages you may need to install: | |
# pip install python-magic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# rubycocoa | |
require 'osx/cocoa' | |
include OSX | |
OSX.require_framework 'ScriptingBridge' | |
class GraffleConverter | |
def initialize | |
@graffle = SBApplication.applicationWithBundleIdentifier_("com.omnigroup.OmniGraffle") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -s | |
/* Run like: | |
% sudo csh | |
# ./spy.d $PROCESS_ID [$INTERESTING_PROBEPROV] | |
Prints a line of dashes every 5 seconds to delineate different experiments. | |
*/ | |
#pragma D option quiet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name | standard name(en_US) | standard name(ja_JP) | short | transition dates | ||||
---|---|---|---|---|---|---|---|---|
Africa/Abidjan | Greenwich Mean Time | グリニッジ標準時 | GMT | |||||
Africa/Accra | Greenwich Mean Time | グリニッジ標準時 | GMT | |||||
Africa/Addis_Ababa | East Africa Time | 東アフリカ時間 | GMT+3 | |||||
Africa/Algiers | Central European Standard Time | 中央ヨーロッパ標準時 | GMT+1 | |||||
Africa/Asmara | East Africa Time | 東アフリカ時間 | GMT+3 | |||||
Africa/Bamako | Greenwich Mean Time | グリニッジ標準時 | GMT | |||||
Africa/Bangui | West Africa Standard Time | 西アフリカ標準時 | GMT+1 | |||||
Africa/Banjul | Greenwich Mean Time | グリニッジ標準時 | GMT | |||||
Africa/Bissau | Greenwich Mean Time | グリニッジ標準時 | GMT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5] | |
func partition(v: Int[], left: Int, right: Int) -> Int { | |
var i = left | |
for j in (left + 1)..(right + 1) { | |
if v[j] < v[left] { | |
i += 1 | |
(v[i], v[j]) = (v[j], v[i]) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSTimeInterval)frameRateForMovie:(QTMovie *)movie | |
{ | |
for (QTTrack *track in [movie tracks]) { | |
QTMedia *media = [track media]; | |
if (![media hasCharacteristic:QTMediaCharacteristicHasVideoFrameRate]) | |
continue; | |
QTTime duration = [(NSValue *)[media attributeForKey:QTMediaDurationAttribute] QTTimeValue]; | |
long sampleCount = [(NSNumber *)[media attributeForKey:QTMediaSampleCountAttribute] longValue]; | |
return sampleCount * ((NSTimeInterval)duration.timeScale / (NSTimeInterval)duration.timeValue); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main.m | |
// creategif | |
// | |
// Created by Kevin Meaney on 21/10/2013. | |
// I've briefly blogged about it here: | |
// http://blog.yvs.eu.com/2013/10/creating-gif-animations-using-coreimagequartz | |
// The following code is all that is all the code needed for a creating a command line tool to generate | |
// a gif animation from image files. | |
// The main limitation with this code is that apart from the frame delay time of 0.1 second, every |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
FILE=`man -w $1` | |
command=`echo $FILE | sed -e "s/.*\/\(.*\)\..*$/\1/"` | |
TMP_FILE=/tmp/for-epub-$command.html | |
EPUB_FILE=`pwd`/$command.epub | |
man $command | man2html > $TMP_FILE | |
~/Applications/calibre.app/Contents/MacOS/ebook-convert $TMP_FILE $EPUB_FILE --no-default-epub-cover --title "$command" --language "en" --dont-split-on-page-breaks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// clang -g -Weverything -framework Foundation literals.m -o literals | |
/* @file literals.m | |
* @author Jeremy W. Sherman | |
* @url http://jeremywsherman.com/ | |
* @date 2012-08-27 */ | |
#import <Foundation/Foundation.h> | |
int | |
main(void) | |
{ |