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
tell application "Microsoft Word" | |
activate | |
set currentZoom to percentage of zoom of view of active window | |
set newZoom to (round (currentZoom + 50) / 50) * 50 | |
log newZoom | |
if newZoom <= 500 then | |
set percentage of zoom of view of active window to newZoom | |
end if | |
end tell |
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
using System; | |
using System.Diagnostics; | |
using System.IO; | |
namespace Baconator | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
{ | |
"files": [ | |
{"src": "Contents/example.dll"} | |
], | |
"metadata": { | |
"id": "e.1xample", | |
"authors": [ "Kevin Jones" ], | |
"owners": [ "Kevin Jones" ], | |
"requireLicenseAcceptance": false, | |
"tags": [ "example" ], |
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
f = do require 'thing' |
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
<asp:Wizard runat="server" ID="GAWizard"> | |
<WizardSteps> | |
<asp:WizardStep runat="server" ID="Step1"> | |
Cut a hole in the box | |
</asp:WizardStep> | |
</WizardSteps> | |
</asp:Wizard> |
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
List<string> aList = null; | |
foreach(var str in aList) {...} | |
//How I really wish this compiled: | |
var enumerator = aList == null ? null : aList.GetEnumerator(); | |
try { | |
while (enumerator != null && enumerator.MoveNext()) { | |
var element = (ElementType)enumerator.Current; |
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
open FSharp.Charting | |
open System | |
type ChartApplicationContext() as this = | |
inherit System.Windows.Forms.ApplicationContext() | |
do | |
let handler = new ConsoleCancelEventHandler(fun o e -> this.ExitThread()) | |
Console.CancelKeyPress.AddHandler(handler) | |
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
private static void ChangeToReturnFalse(MethodInfo methodInfo) | |
{ | |
var intPtrConstructor = typeof(IntPtr).GetConstructor(new[] { typeof(void*) }); | |
var method = new DynamicMethod("ChangeToReturnFalse", typeof(IntPtr), Type.EmptyTypes, typeof(ServiceLocationModule)); | |
var generator = method.GetILGenerator(); | |
generator.Emit(OpCodes.Ldftn, methodInfo); | |
generator.Emit(OpCodes.Newobj, intPtrConstructor); | |
generator.Emit(OpCodes.Ret); | |
var addressFunctor = (Func<IntPtr>)method.CreateDelegate(typeof(Func<IntPtr>)); | |
var address = addressFunctor(); |
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
public static int DivRem(int a, int b, out int result) | |
{ | |
result = a % b; | |
return a / b; | |
} |
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
private static string Rot13(string inputText) | |
{ | |
return new string(inputText.Select(c => | |
{ | |
var lower = Char.ToLower(c); | |
if (lower >= 'a' && lower <= 'z' && lower > 'm') return (char)(c - 13); | |
if (lower >= 'a' && lower <= 'z') return (char)(c + 13); | |
return c; | |
}).ToArray()); | |
} |