Skip to content

Instantly share code, notes, and snippets.

View ashishnegi's full-sized avatar

Ashish Negi ashishnegi

  • Software Developer
  • Austin, TX
View GitHub Profile
var again = function() {
console.log("Again at " + new Date());
setTimeout(again, 1000);
};
again();
@ashishnegi
ashishnegi / simple.js
Created June 3, 2014 11:54
sample test
alert();
@ashishnegi
ashishnegi / listclj.clj
Created June 18, 2014 05:11
lists in clojure
;// paste this code in REPL and enjoy
'(1, 2, 3) ;// list of numbers
'("ashish" "negi" "is" "writing" "this" "line") ;// you do not need comma anywhere in clojure :)
'("ashish" 1 "negi" 2) ;// lists can have multiple
@ashishnegi
ashishnegi / codeisdata.clj
Created June 18, 2014 05:16
code-is-data
( + 1 2) ;// it would output 3
;// ( func-name arguments )
( clojure.string/join " " ["ashish" "negi" "is" "writing" "this" "post"] )
;// output
3
"ashish negi is writing this post"
@ashishnegi
ashishnegi / should-not-work.html
Last active August 29, 2015 14:04
Script should come after the DOM simply ...
<html>
<head></head>
<body>
<script>
document.getElementById("my-fancy").innerHTML = "Hello world !!!"
</script>
<div id="my-fancy">
</div>
</body>
@ashishnegi
ashishnegi / should-work.html
Last active August 29, 2015 14:04
Putting script after the dom has rendered should work.
<html>
<head></head>
<body>
<div id="my-fancy">
</div>
<script>
document.getElementById("my-fancy").innerHTML = "Hello world !!!"
</script>
</body>
</html>
(setq inhibit-startup-message t)
(switch-to-buffer "*scratch*")
;(global-linum-mode)
(global-set-key (kbd "\C-x c") 'clipboard-kill-ring-save)
(global-set-key (kbd "\C-x p") 'clipboard-yank)
(setq make-backup-files t)
(setq version-control t)
(setq backup-directory-alist (quote ((".*" . "~/.emacs.d/.emacs_backups/"))))
@ashishnegi
ashishnegi / calculator.clj
Last active November 30, 2016 02:47
calculator-clojure
(ns fpcontest.expression)
(def Term)
(def Factor)
(def ToMod (int (+ 1000000000 7)))
(def toPrint true)
(defn myprintln [& args]
@ashishnegi
ashishnegi / shunting-algo.clj
Last active August 29, 2015 14:07
shunting-yard-algo
;; ------- Euler Functions ---------------
(set! *unchecked-math* true)
(def ToMod (int (+ 1000000000 7)))
(def toPrint false)
(defn myprintln [& args]
(if toPrint
(apply println args)))
@ashishnegi
ashishnegi / shunting-yard-algo.clj
Created October 17, 2014 15:35
Shunting Yard algo implementation for programming contest.
;; ------- Euler Functions ---------------
(set! *unchecked-math* true)
(def ToMod (int (+ 1000000000 7)))
(def toPrint false)
(defn myprintln [& args]
(if toPrint
(apply println args)))