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
MIT License | |
Copyright (c) 2018 Jason Sperske | |
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: |
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
#!/usr/bin/env python3 | |
import struct | |
import re | |
import io | |
from collections import namedtuple | |
GrpFileDefinition = namedtuple('GrpFileDefinition', 'name size') | |
Line = namedtuple('Line', 'a b is_one_sided') |
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
@ECHO OFF | |
@REM SET SOUND=C:\SB16 | |
@REM SET BLASTER=A220 I5 D1 H5 P330 T6 | |
@REM SET MIDI=SYNTH:1 MAP:E | |
@REM SET CTCM=C:\SB16 | |
@REM C:\SB16\DIAGNOSE /S /W=C:\WINDOWS | |
@REM C:\SB16\MIXERSET /P /Q | |
@REM C:\SB16\CTCU.EXE /S /W=C:\WINDOWS | |
PROMPT $p$g | |
PATH C:\NET;C:\WINDOWS;C:\DOS;C:\XTGOLD;C:\TC\BIN;C:\WP51;C:\SOFTMPU;C:\MIDIEMU |
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
function deepSet(keys, value) { | |
return keys.split('.') | |
.reverse() | |
.reduce((acc, current) => ({ | |
[current]: acc | |
}), value); | |
} | |
//You can use it like this: | |
console.log(JSON.stringify(deepSet('foo.name.social.twitter.followers', 100))) |
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
import wx | |
class MyForm(wx.Frame): | |
#---------------------------------------------------------------------- | |
def __init__(self): | |
wx.Frame.__init__(self, None, wx.ID_ANY, "Programmatic binding of accelerators in wxPython", size=(450,150)) | |
# Add a panel so it looks the correct on all platforms | |
panel = wx.Panel(self, wx.ID_ANY) |
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
import java.util.Arrays; | |
public class Examples { | |
public static void main(String ... args) { | |
Solution s = new Solution(); | |
System.out.print("Example problem: "); | |
System.out.println(s.shortest(3, 3, | |
Arrays.asList( | |
Arrays.asList(1, 0, 0), |
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 paint = function (posts, colors, display) { | |
var painter = function (posts, colors, fence, count, display) { | |
var color, total = count; | |
if (posts === 0) { | |
//Would you like to see them? Pass a display function | |
if(display) { | |
display(fence); | |
} | |
return 1; | |
} else { |
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
//An example of this can be seen at https://jsfiddle.net/uLzwv8mx/ | |
function HueSegments(steps) { | |
var segments = [] | |
var step | |
var increment = 200/steps | |
for(step = 0; step < steps; step++) { | |
segments.push("hsla("+(Math.floor(increment*step))+", 100%, "+(step % 2 == 0 ? "75" : "50")+"%, 1)") | |
} | |
return segments | |
} |
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
/* | |
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* - Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* |
NewerOlder