Skip to content

Instantly share code, notes, and snippets.

@patridge
patridge / ScreenshotsFromPowerPointSlides
Last active August 29, 2015 13:56
PowerPoint slide screenshots via AppleScript
tell application "Microsoft PowerPoint"
activate
set slideShow to run slide show slide show settings of active presentation
set finalShotSize to 250
set oPres to active presentation
set desktopPath to (path to desktop)
set N to 1
-- Give presentation enough time to start.
delay 0.5
@ascendbruce
ascendbruce / gist:10584882
Created April 13, 2014 13:46
KKBOX 授權擁有的動漫卡通音樂 集中帖 第一頁 (markdown)

整理自 KKBOX 討論區的「KKBOX 授權擁有的動漫卡通音樂 集中帖」的第一頁(討論串樓主整理的)

需注意後面零星的歌單並沒有整理到這裡

這個 gist 是整理到 ACG Music (Taiwan) 前整理用 temp。

「鋼之鍊金術師」

《劇場版 主題曲》Link-L'Arc-en-Ciel(彩虹樂團)

@gatlingxyz
gatlingxyz / gist:52fb21eb92181716b0ce
Created July 11, 2014 23:49
Unofficial Base WatchFace Activity
import android.app.Activity;
import android.content.Context;
import android.hardware.display.DisplayManager;
import android.os.Bundle;
import android.view.Display;
/**
* A base activity for watch faces that have callbacks for the various screen states (dim, awake, and off)
* as well as a callback for when the watch face is removed.
* <p/>
private void exportDB() {
String SAMPLE_DB_NAME = "your database name";
File sd = Environment.getExternalStorageDirectory();
File data = Environment.getDataDirectory();
FileChannel source = null;
FileChannel destination = null;
String currentDBPath = "/data/" + "your package name"
+ "/databases/" + SAMPLE_DB_NAME;
@import Foundation;
@interface KKWatchAppNotificationCenter : NSObject
+ (instancetype)sharedCenter;
- (void)postNotification:(NSString *)key;
- (void)addTarget:(id)target selector:(SEL)selector name:(NSString *)notification;
- (void)removeObserver:(NSObject *)observer;
@end
@tomvdb
tomvdb / gist:4267270
Created December 12, 2012 12:05
Sniffing Bluetooth traffic between Samsung Galaxy S3 and Bluetooth Device Recipe
Ingredients:
(1) Rooted Samsung Galaxy S3 (CF-Auto-Root, SuperSU, adbd Insecure)
(2) https://github.com/d34th4ck3r/Hcidump-in-Android (only need the binary in libs/armeabi)
(3) Bluetooth Device
Method:
on pc:
@alokc83
alokc83 / xcode-versionString-generator.sh
Last active December 15, 2015 06:59
<<<<<<<<<< STILL IN ALPHA, HAVING SOME MAJOR KNOWN BUG. USE IT ON YOUR RESPONSIBILITY >>>>>>>>>>>>>>> KNOWN ISSUES : 1] Not able to handle major and minor version change. This automatic version generator. basis of following format Major version.Minor Version.Revision It keeps updating the revision. This script automatically add two custom proper…
# xcode-version-generator.sh
# @desc Auto-increment the version number (only) when a project is archived for export.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Check the checkbox "Run script only when installing"
# 6. Drag the "Run Script" below "Link Binaries With Libraries"
# 7. Insure your starting version number is in SemVer format (e.g. 1.0.0)
require 'xcodeproj'
project_path = "your_project_path";
# Create project object
project = Xcodeproj::Project.new(project_path);
lib_path = "your_lib_path";
# Add the lib file as a reference
libRef = project.new_file(lib_path, "Frameworks");
@nlinker
nlinker / ConversionUtils
Created September 18, 2012 06:17
How to serialize/deserialize json for generic types with Gson
import com.google.gson.*;
import com.google.gson.reflect.TypeToken;
public class ConversionUtils {
// both
private static Type typeB = new TypeToken<SpellData>() { }.getType();
private static Gson gson;
static {
#!/bin/bash
# This script will check an IPA and determine if the specified UDID is in the embedded provisioning profile
IPA=$1
UDID=$2
if [ $# -eq "1" ]
then
echo "Please specify a UDID to check for."