Here's an example of how to embed a Gist on GitHub Pages:
{% gist 5555251 %}
All you need to do is copy and paste the Gist's ID from the URL (here 5555251
), and add it to a gist
tag surrounded by {%
and %}
.
using System; | |
using System.ComponentModel; | |
using System.Runtime.InteropServices; | |
namespace ComWithoutRegisteringExample | |
{ | |
internal static class ComHelper | |
{ | |
private delegate int DllGetClassObject(ref Guid clsid, ref Guid iid, [Out, MarshalAs(UnmanagedType.Interface)] out IClassFactory classFactory); |
Here's an example of how to embed a Gist on GitHub Pages:
{% gist 5555251 %}
All you need to do is copy and paste the Gist's ID from the URL (here 5555251
), and add it to a gist
tag surrounded by {%
and %}
.
using UnityEngine; | |
using System.Reflection; | |
public class TerriblyHackyLog : MonoBehaviour | |
{ | |
void Start () | |
{ | |
Log ("Aaaaarrrrgh!"); | |
} |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
using System; | |
namespace Brainfuck { | |
class MainClass { | |
public static void Main (string[] args) { | |
Console.WriteLine ("Enter Command Buffer: "); | |
string commandBuffer = Console.ReadLine (); | |
int[] memory = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | |
int memoryPointer = 0; |
using System; | |
using System.Diagnostics; | |
using System.Reflection.Emit; | |
using System.Runtime.InteropServices; | |
using System.Security; | |
namespace TestPerf | |
{ | |
public class Benchmark | |
{ |
using UnityEngine; | |
/* | |
Copyright 2016 Max Kaufmann (max.kaufmann@gmail.com) | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
As someone that regularly has multiple SSH/VPN sessions open, it can be a huge inconvience to lose all the connections when I lock my screen to get up to go to a meeting, lunch, etc. This is especially true for those connections that require two factor authentication. So, how can I tell my MacBook to keep those connections alive, even though my screen is locked?
Well, turns out that it is pretty simple. All that is needed is to run the following command.
cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources
sudo ./airport en0 prefs DisconnectOnLogout=NO
On OSX Yosemite and above, in a terminal window: | |
1. Switch to the root user. | |
$ sudo su - | |
2. Create a Dummynet pipe that represents a slow, unreliable network: | |
# dnctl pipe 1 config bw 10Kbit/s delay 300 plr 0.1 noerror |
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'