This file contains 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.IO; | |
using System.Linq; | |
namespace FileArranger | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains 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
# download release from github: https://github.com/monostream/tifig/releases and install at ~/tools/tifig | |
# then run these commands in the folder (just to keep things simple we normalize the file extension case before proceeding). | |
for f in *.HEIC; do mv "$f" "`echo $f | sed s/.HEIC/.heic/`"; done | |
for file in *.heic; do echo "~/tools/tifig -v -p $file ${file/%.heic/.jpg}"; done |
This file contains 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
var a = function() { | |
alert('bang!'); | |
} | |
var signedIntMax = 2147483647; | |
var signedIntMaxPlus1 = signedIntMax+1; // will cause bang immediately on webkit/firefox but not IE | |
setInterval(a, signedIntMaxPlus1); |
This file contains 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
Ext.define("MyApp.ChartTitleMixin", { | |
createTitleItem: function() { | |
this.chartTitle = new Ext4.draw.Sprite({ | |
type: "text", | |
"text-anchor": "middle", | |
fill: "black", | |
"font-size": "12px", | |
"font-weight": "bold", | |
"font-family": "Arial", | |
text: this.title |
This file contains 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
Grab git from here if you don't have it (and don't have another SCM you want to use instead): | |
http://git-scm.com/downloads | |
Initialize a git repository. | |
mkdir session3 | |
cd session3 | |
git init |
This file contains 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
var evalRules = function(isAlive, neighbours) { | |
var isAliveAfterTick = false; | |
var dead = function() { | |
isAliveAfterTick = false; | |
return true; | |
}; | |
var live = function() { |
This file contains 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 namespace MyCompany.MyProject.MyFeature { | |
public class MySuite { | |
public MySuite() { | |
// SetupSomeTestData in here - but oh noi throw an error. | |
throw new Exception("bang!"); | |
} | |
[Fact] |
This file contains 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 class GenericActionList | |
{ | |
readonly IList<Action<object>> _actions = new List<Action<object>>(); | |
public void AddAction<T>(Action<T> action) | |
where T : class | |
{ | |
_actions.Add(input => Invoke(action, input)); | |
} |
This file contains 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
/// <summary> | |
/// MemoryTributary is a re-implementation of MemoryStream that uses a dynamic list of byte arrays as a backing store, instead of a single byte array, the allocation | |
/// of which will fail for relatively small streams as it requires contiguous memory. | |
/// </summary> | |
public class MemoryTributary : Stream /* http://msdn.microsoft.com/en-us/library/system.io.stream.aspx */ | |
{ | |
#region Constructors | |
public MemoryTributary() | |
{ |
This file contains 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
namespace MonkeyCoconuts | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
for (int i=0; i<10000000; i++) | |
{ | |
if (test(i)) | |
{ |
NewerOlder