Skip to content

Instantly share code, notes, and snippets.

@dzenand
dzenand / TouchInjector.cs
Created July 24, 2013 08:49
Wrapper around Windows InjectTouchInput API
using System;
using System.Runtime.InteropServices;
namespace Utilities.Input
{
/// <summary>
/// Use this Classes static methods to initialize and inject touch input.
/// </summary>
public class TouchInjector
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@dakoctba
dakoctba / gist:7676845
Last active July 13, 2024 11:54
How To Reset Your Github Fork

##How To Reset Your Github Fork

Let’s say I want to contribute to a project on github. The project repository is at wp-cli/wp-cli. First I fork it, and then clone the resulting repository, scribu/wp-cli:

git clone --recursive git@github.com:scribu/wp-cli.git
cd wp-cli

Now, I make some commits to master, push them to my fork and open a pull request. Piece of cake:

git commit -m "awesome new feature"

@trusktr
trusktr / DefaultKeyBinding.dict
Last active July 17, 2024 05:21
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@shimondoodkin
shimondoodkin / php_tiny_curl.php
Last active May 6, 2024 10:51
php tiny curl - a curl function with method, data, headers, cookies, simple to use.
function encodeURIComponent($str) {
$revert = array('%21'=>'!', '%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')');
return strtr(rawurlencode($str), $revert);
}
class curl_onHeaders
{
@lopspower
lopspower / README.md
Last active July 20, 2024 20:26
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@Zazcallabah
Zazcallabah / transparency.ahk
Created January 23, 2017 08:27
AutoHotkey Script for controlling transparency of windows. I cant remember who made this, saved for future reference
; [Win+A] Toggle always on top
#a:: Winset, Alwaysontop, , A
; [Win+WheelUp] Increase opacity
#WheelUp::
DetectHiddenWindows, on
WinGet, curtrans, Transparent, A
if ! curtrans
curtrans = 255
newtrans := curtrans + 8
@Konafets
Konafets / DataTable.vue
Last active July 23, 2019 15:17
Watching child component computed properties
<template>
<table-component
:data="[
{ firstName: 'John', birthday: '04/10/1940'},
{ firstName: 'Paul', birthday: '18/06/1942'},
{ firstName: 'George', birthday: '25/02/1943'},
{ firstName: 'Ringo', birthday: '07/07/1940'},
]"
sort-by="firstName"
sort-order="asc"
@wkliwk
wkliwk / btt.sh
Last active July 18, 2024 03:38
BTT reset trial time
# BetterTouchTool reset trial time
# ** All preference will reset
echo "remove ~/Library/Preferences/com.hegenberg.BetterTouchTool.plist"
rm -rf ~/Library/Preferences/com.hegenberg.BetterTouchTool.plist
echo "Done"
echo "remove ~/Library/Application\ Support/BetterTouchTool/"
rm -rf ~/Library/Application\ Support/BetterTouchTool/
echo "Done"
<!DOCTYPE html>
<html>
<head>
<title>Lazy load youtube embed</title>
<meta charset="UTF-8" />
</head>
<body>
<main>
<h1>Example of a lazy loaded embedded YouTube video</h1>
<iframe