Skip to content

Instantly share code, notes, and snippets.

View epogrebnyak's full-sized avatar

Evgeny Pogrebnyak epogrebnyak

View GitHub Profile
@ceilfors
ceilfors / ssh-copy-id.py
Last active June 3, 2023 01:48
ssh-copy-id for Windows
"""ssh-copy-id for Windows.
Example usage: python ssh-copy-id.py ceilfors@my-remote-machine
This script is dependent on msysgit by default as it requires scp and ssh.
For convenience you can also try that comes http://bliker.github.io/cmder/.
"""
import argparse, os
from subprocess import call
@asmedrano
asmedrano / readcsv.go
Created February 12, 2014 15:54
Go read csv
package main
import (
"encoding/csv"
"fmt"
"io"
"os"
)
// documentation for csv is at http://golang.org/pkg/encoding/csv/
@peterkuma
peterkuma / server.py
Created February 10, 2014 14:22
A flask server for serving all JPEG images in a local directory and subdirectories. Uses unveil.js for lazy-loading of images. Thumbnails are created on the fly by PIL.
#!/bin/python
import os
from flask import Flask, Response, request, abort, render_template_string, send_from_directory
import Image
import StringIO
app = Flask(__name__)
WIDTH = 1000
@MikeInnes
MikeInnes / startup.jl
Last active April 28, 2025 14:51
Some useful macros for Julia
# Repeat an operation n times, e.g.
# @dotimes 100 println("hi")
macro dotimes(n, body)
quote
for i = 1:$(esc(n))
$(esc(body))
end
end
end
@kseo
kseo / CombinatorParser.hs
Created December 20, 2013 03:10
Monadic Parsing in Haskell
module CombinatorParser where
import Control.Monad
import Data.Char
-- FUNCTIONAL PEARLS: Monadic Parsing in Haskell
-- http://eprints.nottingham.ac.uk/223/1/pearl.pdf
newtype Parser a = Parser { parse :: (String -> [(a, String)]) }
@rxaviers
rxaviers / gist:7360908
Last active July 22, 2025 05:50
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@sloria
sloria / bobp-python.md
Last active May 28, 2025 02:41
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@iandanforth
iandanforth / kmeansExample.py
Last active May 13, 2024 14:00
A pure python implementation of K-Means clustering. Optional cluster visualization using plot.ly.
#############################################################################
# Full Imports
from __future__ import division
import math
import random
"""
This is a pure Python implementation of the K-means Clustering algorithmn. The
original can be found here:
@cobyism
cobyism / gh-pages-deploy.md
Last active July 1, 2025 06:35
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@chriscasola
chriscasola / README.txt
Last active June 13, 2022 08:30
A python script to generate a table of contents for a GitHub Flavored markdown file. The file must contain a level one header with a title that contains "Table of Contents". The script will generate a TOC containing all level 1, 2, and 3 headers.
A python script to generate a table of contents (with links) for a GitHub Flavored markdown file.
The file must contain a level one header with a title that contains "Table of Contents".
The script will generate a TOC containing all level 1, 2, and 3 headers.
Run the script like this:
python tocgen.py inFileName outFileName
BEFORE file:
--------------------------------------------------------
This is my GitHub wiki page.