Skip to content

Instantly share code, notes, and snippets.

@kkm
kkm / gist:474c70713ab93e40308e
Last active August 29, 2015 14:17
dshow device list
#include <windows.h>
#include <dshow.h>
#pragma comment(lib, "strmiids")
HRESULT EnumerateDevices(REFGUID category, IEnumMoniker **ppEnum)
{
// Create the System Device Enumerator.
ICreateDevEnum *pDevEnum;
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,
/*
============================================================================
Name : test_ffmpeg.c
Author :
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/
@kkm
kkm / gist:61e4602ca159165a68f7
Created June 3, 2015 21:30
bitmap source write
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" applicationComplete="init(event)">
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function init(event:FlexEvent):void {
var bitmapdata:BitmapData = new BitmapData(320, 240, false, 0x000000);
@kkm
kkm / gist:a8df1d772fca43932218
Created July 11, 2015 04:53
CSS always in top in meteor template
var script = document.createElement('link');
script.setAttribute('href', 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css');
script.setAttribute('rel', 'stylesheet');
script.setAttribute('type', 'text/css');
var pa = document.getElementsByTagName('head')[0];
document.getElementsByTagName('head')[0].insertBefore(script, pa.firstChild);
//version
var appXml:XML = NativeApplication.nativeApplication.applicationDescriptor;
var ns:Namespace = appXml.namespace();
var appVersion:String = appXml.ns::versionNumber[0];
@kkm
kkm / demo.cs
Last active May 19, 2016 02:47
Outlook Autocomplete Raw and Sender
Outlook.Accounts accounts = Application.Session.Accounts;
foreach (Outlook.Account account in accounts) {
Debug.WriteLine("Sender: " + account.SmtpAddress);
Outlook.StorageItem storage = account.DeliveryStore.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox).GetStorage("IPM.Configuration.Autocomplete", Outlook.OlStorageIdentifierType.olIdentifyByMessageClass);
Outlook.PropertyAccessor pa = storage.PropertyAccessor;
byte[] raw_autocomplete_bytes = (byte[]) pa.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x7C090102");
Debug.WriteLine("Raw Bytes from Autocomplete: " + raw_autocomplete_bytes.Length);
}
"use strict";
var colors = require("D:\\kkm\\Desktop\\node_modules\\colors");
var robot = require("C:\\Users\\kkm\\node_modules\\robot-js");
var mouse = robot.Mouse();
var keyboard = robot.Keyboard();
mouse.autoDelay.min = 1;
mouse.autoDelay.max = 1;
var img = robot.Image();
W20160908-14:48:01.638(2)? (STDERR)
W20160908-14:48:01.664(2)? (STDERR) TypeError: Object has no method 'replace'
W20160908-14:48:01.664(2)? (STDERR) at makeErrorByStatus (packages/http/httpcall_common.js:10:1)
W20160908-14:48:01.665(2)? (STDERR) at Request._callback (packages/http/httpcall_server.js:109:1)
W20160908-14:48:01.665(2)? (STDERR) at Request.self.callback (/home/vmail/.meteor/packages/http/.1.1.0.dehp6n++os+web.browser+web.cordova/npm/node_modules/request/request.js:344:22)
W20160908-14:48:01.665(2)? (STDERR) at Request.emit (events.js:98:17)
W20160908-14:48:01.666(2)? (STDERR) at Request.<anonymous> (/home/vmail/.meteor/packages/http/.1.1.0.dehp6n++os+web.browser+web.cordova/npm/node_modules/request/request.js:1239:14)
W20160908-14:48:01.666(2)? (STDERR) at Request.emit (events.js:117:20)
W20160908-14:48:01.666(2)? (STDERR) at IncomingMessage.<anonymous> (/home/vmail/.meteor/packages/http/.1.1.0.dehp6n++os+web.browser+web.cordova/npm/node_modules/request/request.js:11
var scrollToHash = function(hash, time) {
hash = hash || window.location.hash;
time = time || 1000;
k = Meteor.setInterval(function() {
try {
clearInterval(k);
console.log("XW", hash);
$('html,body').animate({
scrollTop : $(hash).offset().top
}, time);
export PS1="\[\033[1;93m\]\u\[\033[1;93m\]@\[\033[1;93m\]\h:\[\033[1;96m\]\w\[\033[m\]\n\$ "
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced