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
| ClearAll[Let, let, symbolOrListQ]; | |
| SetAttributes[{Let, let, symbolOrListQ}, HoldAll]; | |
| Let::lvset = "Local variable specification `1` is not valid."; | |
| Let /: Verbatim[SetDelayed][lhs_, rhs : HoldPattern[Let[__, _]]] := | |
| Block[{With}, Attributes[With] = {HoldAll}; | |
| lhs := Evaluate[rhs /. HoldPattern[With[{}, b_]] :> b]]; | |
| Let[args : HoldPattern[Set[_?symbolOrListQ, _] ...], body_] := |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| Mandelbrot[c_] := Module[{z = 0, i = 0}, While[i < 100 && Abs[z] < 2, z = z^2 + c; i++]; i]; | |
| DensityPlot[Mandelbrot[xc + I yc], {xc, -2, 1}, {yc, -1.5, 1.5}, | |
| PlotPoints -> 275, Mesh -> False, Frame -> False, | |
| ColorFunction -> (If[# != 1, Hue[#], Hue[0, 0, 0]] &)] |
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
| MazeGraphics[m_, n_] := | |
| Block[{$RecursionLimit = Infinity, | |
| unvisited = Tuples[Range /@ {m, n}], maze}, | |
| maze = Graphics[{Line[{{#, # - {0, 1}}, {#, # - {1, 0}}}] & /@ | |
| unvisited, | |
| Line[{{0, n}, {0, 0}, {m, 0}}]}]; {unvisited = | |
| DeleteCases[unvisited, #]; | |
| Do[If[MemberQ[unvisited, neighbor], | |
| maze = DeleteCases[ | |
| maze, {#, |
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
| Set[f[x_], | |
| ReplaceAll[Times[A, Exp[-x]], | |
| First[Solve[ | |
| Equal[Integrate[Times[A, Exp[-r]], {r, -Infinity, Infinity}], 1], A]]]] |
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
| ClearAll[Let, let, symbolOrListQ, inSetDelayed]; | |
| SetAttributes[{Let, let, symbolOrListQ}, HoldAll]; | |
| symbolOrListQ[_Symbol] = True; | |
| symbolOrListQ[{___?symbolOrListQ}] = True; | |
| symbolOrListQ[_] = False; | |
| Let::lvset = "Local variable specification `1` is not valid."; |
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
| circleLine[x_, y_, s_] := | |
| Module[{d = 3/2*Sin[s + (x/2 + y)/10*Pi] + 3/2}, | |
| Graphics[ | |
| If[{x, y} == {7, 7}, {LightGray, Line[{{x, y}, {x + 3, y - 3}}], | |
| Red}, {}]~Join~ | |
| {Circle[{x + d, y - d}, 0.1]} | |
| ] | |
| ]; | |
| frames = Table[ |
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
| data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> | |
| <!-- | |
| For other language: Instead of `ace/mode/ruby`, Use | |
| Markdown -> `ace/mode/markdown` | |
| Python -> `ace/mode/python` | |
| C/C++ -> `ace/mode/c_cpp` | |
| Javscript -> `ace/mode/javascript` | |
| Java -> `ace/mode/java` | |
| Scala- -> `ace/mode/scala` |
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
| #-------------------------------------------------------------------------------------------- | |
| # if found on gist use `git clone https://gist.github.com/650d59476b86fbe885e66af953099006.git .` | |
| # this is a modified version of Emmanuel Rouat [no-email] bashrc how to which can be found at | |
| # `http://tldp.org/LDP/abs/html/sample-bashrc.html` | |
| #-------------------------------------------------------------------------------------------- | |
| # If not running interactively, don't do anything | |
| [ -z "$PS1" ] && return | |
| #------------------------------------------------------------- |
OlderNewer
