Skip to content

Instantly share code, notes, and snippets.

View harish2704's full-sized avatar

Harish Karumuthil harish2704

View GitHub Profile
@karpathy
karpathy / min-char-rnn.py
Last active May 9, 2024 14:16
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)
<?php header("Content-Type: text/plain"); ?>
<?php header("Content-Disposition: inline"); ?>
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
//IMPORTANT: Update the pin and length to match your LED strip!
#define PIN 5
#define LENGTH 150
@jack-guy
jack-guy / feathers.d.ts
Last active September 7, 2017 10:34
These are basic typings for Feathers.js based off of those in DefinitelyTyped for Express. This doesn't type feathers plugins, but does have some interfaces that can be used in them. WIP.
// Type definitions for Feathers
// Project: http://feathersjs.com/
// Definitions by: Jack Guy <http://thatguyjackguy.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { Application, Handler, ErrorRequestHandler } from 'express';
type HandlerArgument = Handler | Handler[];
export = Feathers;
@csswizardry
csswizardry / README.md
Last active April 2, 2024 20:17
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
@harish2704
harish2704 / sendmail.js
Last active May 14, 2022 10:55
Psudo sendmail script for testing
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const mailDir = path.join( __dirname, '..', '..', 'test-mails' );
const {stdin} = process;
async function getStdin() {
let result = '';
@jerinphilip
jerinphilip / render.py
Last active June 30, 2023 09:35 — forked from santhoshtr/render.py
PangoCairo Text rendering
#!/usr/bin/python3
#-*- coding:utf8 -*-
# Modified for python3
# python2 version https://gist.github.com/santhoshtr/bea3da00651bcd18e282
import cairo
from gi.repository import Gtk, Gdk, Pango, PangoCairo
import cairo
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 600, 100)
context = cairo.Context(surface)
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 9, 2024 22:33
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 10, 2024 06:00
set -e, -u, -o, -x pipefail explanation