Skip to content

Instantly share code, notes, and snippets.

View priyatam's full-sized avatar

Priyatam Mudi priyatam

View GitHub Profile
@karpathy
karpathy / min-char-rnn.py
Last active April 16, 2024 18:25
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
module Main1 where
data HashSet a = native java.util.HashSet where
native new :: () -> STMutable s (HashSet a)
native size :: Mutable s (HashSet a) -> ST s Int
native add :: Mutable s (HashSet a) -> a -> ST s Bool
native remove :: Mutable s (HashSet a) -> a -> ST s Bool
main :: IO ()
main = do
@wagjo
wagjo / gist:27ce6a34d5d5257a0790
Last active September 24, 2015 19:41
JWT Parsing in Dunaj
(ns foo.core
(:api dunaj)
(:require [dunaj.host.int :refer [i== iDOT]]
[dunaj.host.array :as dha]
[dunaj.format.base64 :refer [base64-safe]]
[dunaj.coll.recipe :refer [concat*]]
[dunaj.concurrent.port :refer [reduce! onto-chan!]]))
(def+ ByteColl [java.lang.Byte]) ;; type signature
@klang
klang / dynamodb.org
Created April 10, 2015 09:04
Example usage of DynamoDB from the cli (inside emacs, via org-mode)

Set up the environment

(setq org-confirm-babel-evaluate nil)
(setq org-babel-sh-command "ssh default ")
;; customize the following variables:
;;(setq org-babel-load-languages 
;;<<< '((emacs-lisp . t) (python . t) (clojure . t) (sh . t ) (perl . t)))
@bhauman
bhauman / core.cljs
Last active August 16, 2022 12:08
Helpful patterns when developing with ClojureScript Figwheel and Express js
(ns todo-server.core
(:require
[cljs.nodejs :as nodejs]
[figwheel.client :as fw]))
(nodejs/enable-util-print!)
(defonce express (nodejs/require "express"))
(defonce serve-static (nodejs/require "serve-static"))
(defonce http (nodejs/require "http"))
@taylorlapeyre
taylorlapeyre / description.md
Last active August 29, 2015 14:08
A clever problem for an interview or just for fun

Generating HTML

Say that one day we decide to write a new templating library for generating HTML.

In this new library, you are passed an array where the first element is the name of an HTML tag, the second element is optionally a hash containing the element's HTML attributes, and the rest of the elements are the HTML elements that are children of it.

For example:

html = [:html,
@shishkin
shishkin / async.clj
Created October 22, 2014 10:37
Clojure core.async configurable polling for a change of a non-reactive function
;### Tested with clojure "1.6.0" and core.async "0.1.346.0-17112a-alpha" ###
(use 'clojure.core.async)
;### Lib functions ###
(defn take-until
"Creates a channel that replicates values from the in channel until the
control channel either emits a value or closes."
[control in]
(let [out (chan)]
@ericlbarnes
ericlbarnes / bower.json
Last active January 8, 2024 01:52
Gulp, Bower, Bootstrap Sass, FontAwesome
{
"name": "project",
"version": "0.0.0",
"authors": [
"Eric Barnes <me@example.org>"
],
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
@zahardzhan
zahardzhan / Common Words.md
Last active July 31, 2016 05:26
Program Pearls, Continued: Common Words, Clojure

Program Pearls, Continued: Common Words (1986)

from Literate Programming, D. Knuth, 1992, Chapter 6.

The purpose of this program is to solve the following problem posed by Jon Bentley:

Given a text file and an integer k, print the k most common words in the file (and the number of their occurrences) in decreasing frequency.

Solution