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
pid=`pgrep TextEdit` sudo dtrace -n 'pid$pid::mach_port_allocate:entry,pid$pid::mach_port_destroy:entry,pid$pid::mach_port_deallocate:entry { ustack(); }' |
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
$ sips -g all image.png | |
# pixelWidth: 32 | |
# pixelHeight: 32 | |
# typeIdentifier: public.png | |
# format: png | |
# formatOptions: default | |
# dpiWidth: 72.000 | |
# dpiHeight: 72.000 | |
# samplesPerPixel: 4 |
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
system_profiler SPUSBDataType |
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
# query p8 cec-adapter about firmware etc | |
$ cec-client -d 1 -s -l | |
log level set to 1 | |
Found devices: 1 | |
device: 1 | |
com port: /dev/cu.usbmodemv2 r1 | |
vendor id: 2548 | |
product id: 1002 | |
firmware version: 4 |
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); | |
} |
NewerOlder