Skip to content

Instantly share code, notes, and snippets.

View babyking's full-sized avatar

Baby King babyking

View GitHub Profile
@dcunited001
dcunited001 / keyremap.applescript
Created December 6, 2012 19:53
Applescript to Reload KeyRemap4MacBook Private.xml
on run {input, parameters}
--version >= 7.99.5
--use "launch application" step instead
--tell application "KeyRemap4MacBook" to activate
tell application "System Events"
--version >= 7.99.5
tell application process "KeyRemap4MacBook"
@szolotykh
szolotykh / JSCameraTest.html
Created December 26, 2014 16:09
HTML5 Camera test
<html>
<script>
var errorCallback = function(e) {
console.log('Rejected', e);
};
function init(){
navigator.getUserMedia = navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||
@babyking
babyking / private.xml
Last active December 14, 2015 07:49 — forked from lucifr/private.xml
keyremap4macbook配置文件.主要将capslock键映射到一个虚拟键F19, 以这个F19做最终的功能键扩展. 与目前的ctrl shift option command自带的组合快捷键,均不冲突!
<root>
<!--
<devicevendordef>
<vendorname>thinkpad_trackpoint</vendorname>
<vendorid>0x17ef</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>my_thinkpad_trackpoint</productname>
<productid>0x6009</productid>
</deviceproductdef>
@jerray
jerray / Keyremap4MacBook_private.xml
Created August 26, 2012 07:35
KeyRemap4MacBook的自定义键位映射
<?xml version="1.0"?>
<root>
<item>
<name>7lemon custom settings</name>
<!--
互换option键和command键(虚拟机和远程桌面除外)
外接键盘用。可配合"General"中的"Don't remap Apple's keyboards"使用
-->
<item>
<name>Swap Option_L and Command_L</name>
@h2non
h2non / json-post.swift
Last active September 11, 2022 01:38
JSON POST example with Alamofire
let parameters = [
"username": "foo",
"password": "123456"
]
Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters, encoding: .JSON)
// -> HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}}
@johndpope
johndpope / JPMixer.swift
Last active September 14, 2022 16:21
SongProcessor AudioKit - hack to play multiple files at once
//
// Mixer.swift
// SongProcessor
//
// Created by Pope, John on 8/10/17.
// Copyright © 2017 AudioKit. All rights reserved.
//
import Foundation
import AudioKit
@Kapenaar
Kapenaar / thin.yml
Last active September 23, 2022 03:01
Default config file for thin web server with comments
### SERVER OPTIONS ###
## Bind Address
#address: HOST # Default: 0.0.0.0
## Bind port. If using multiple thin servers,
## they will bind to (PORT + n) where n is the server number
#port: PORT # Default: 3000
@srikanthjeeva
srikanthjeeva / https GET request with Basic Auth in Ruby
Created January 28, 2015 20:33
https GET request with Basic Auth in Ruby
require 'net/http'
require 'net/https'
require 'uri'
uri = URI('https://example.com/rest/api/2/1')
Net::HTTP.start(uri.host, uri.port,
:use_ssl => uri.scheme == 'https',
:verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http|
@wisaruthk
wisaruthk / FVRInAppPurchaseVC.swift
Last active July 15, 2023 16:35
iOS In App Purchase Example with appusername
//
// FVRInAppPurchaseVC.swift
// favroutes
//
// Created by wisaruthk on 10/8/2558 BE.
// Copyright © 2558 kojo. All rights reserved.
//
import UIKit
import StoreKit