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
##Create a new repository on the command line## | |
touch README.md | |
git init | |
git add README.md | |
git commit -m "first commit" | |
git remote add origin https://github.com/sifeij/ScratchPaper.git | |
git push -u origin master | |
##Push an existing repository from the command line## |
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.Linq; | |
using System.Text; | |
using System; | |
namespace CustomExtensions | |
{ | |
//Extension methods must be defined in a static class | |
public static class StringExtension | |
{ | |
// This is the extension method. |
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
class Comparer<T> : IEqualityComparer<T> | |
{ | |
public readonly Func<T, T, bool> _comparer; | |
public Comparer(Func<T, T, bool> comparer) | |
{ | |
if (comparer == null) | |
throw new ArgumentNullException("comparer"); | |
_comparer = comparer; |
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
1. Use === and !== Instead of == and != | |
2. Eval = Bad | |
3. Do not use short-hand, for example: omitting curly braces and semi-colons | |
4. Utilize http://www.jslint.com/ | |
5. Place Scripts at the Bottom of Your Page |
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
DECLARE @mydate DATETIME | |
SELECT @mydate = CONVERT(VARCHAR(25),GETDATE(),101) | |
SELECT DATEADD(dd, -(DAY(@mydate)), @mydate) AS DateValue, 'Last Day of Previous Month' AS DateType | |
UNION ALL | |
SELECT DATEADD(s, -1, DATEADD(mm, DATEDIFF(m, 0, @mydate),0)) AS DateValue, 'Last Day of Previous Month' AS DateType | |
UNION ALL | |
SELECT DATEADD(dd, -(DAY(@mydate)-1), @mydate) AS DateValue, 'First Day of Current Month' AS DateType | |
UNION ALL | |
SELECT DATEADD(m, DATEDIFF(m, 0, @mydate), 0) AS DateValue, 'First Day of Current Month' AS DateType |
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 ExplicitDependencies | |
{ | |
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
<Query Kind="Program"> | |
<NuGetReference>HtmlAgilityPack</NuGetReference> | |
<Namespace>HtmlAgilityPack</Namespace> | |
<Namespace>System.Net</Namespace> | |
</Query> | |
void Main() | |
{ | |
var sites = new[] { | |
"http://www.alvinashcraft.com/", |
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
// JS array equivalents to C# LINQ methods - by Dan B. | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, | |
{ name: "Judy", age: 42 }, | |
{ name: "Tim", age: 8 } |
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
//@version=2 | |
strategy(title='Beat the Odds 1D setups', shorttitle='1D setups', overlay=true, pyramiding=0, initial_capital=1000, currency=currency.USD) | |
//----------------- EMA 1 -------------------------------------------------------------------------------------------// | |
src0 = close, len0 = input(9, minval=1, title="Fast EMA Cross") | |
emaFast = ema(src0, len0) | |
direction = rising(emaFast, 2) ? +1 : falling(emaFast, 2) ? -1 : 0 | |
plot_color = direction > 0 ? lime: direction < 0 ? red : na |
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
//@version=2 | |
study(title='Alert 1D', shorttitle='Alert 1D', overlay=false) | |
duration=input('9D') | |
ch1 = security(tickerid, duration, open) | |
ch2 = security(tickerid, duration, close) | |
// Signals// | |
long = crossover(ch2, ch1) |
OlderNewer