Skip to content

Instantly share code, notes, and snippets.

View epogrebnyak's full-sized avatar

Evgeny Pogrebnyak epogrebnyak

View GitHub Profile
@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
@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/
@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
@avitale
avitale / totalsize.jl
Last active February 16, 2020 12:51
Total size of Julia objects
module Totalsizeof
importall Base
export totalsizeof
# Helper: Pointer cache is used to break circular references in objects and avoid double countings
is_seen!(x, ptr_cache) = in(pointer_from_objref(x), ptr_cache) || (push!(ptr_cache, pointer_from_objref(x)); false)
# Helper: Catch types without size method
sizeof_catch(x) = try sizeof(x) catch 0 end
@will-henney
will-henney / internal-links-test.org
Last active August 23, 2022 20:59
Tests of internal link syntax in emacs org-mode and in org-ruby
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active May 5, 2024 00:12
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@milibopp
milibopp / mpl_multipage_pdf.py
Last active December 17, 2019 21:29
Matplotlib multiple pages in PDF
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backends.backend_pdf import PdfPages
with PdfPages('multipage.pdf') as pp:
for i in range(0, 10):
fig = plt.figure()
ax1 = fig.add_subplot(211)
ax2 = fig.add_subplot(212)
x = np.linspace(0, 10)
@nickautomatic
nickautomatic / cmder.md
Last active September 20, 2023 13:59
Setting up Cmder to use bash by default

Set up cmder to use msysgit / bash by default

  • Install cmder_mini (msysgit is already installed, so no need for full version)
  • In Cmder, open settings: Win + Alt + P
  • Under Startup > Tasks, add a task called {bash} with the following settings:
    • Task parameters (set icon):
      • For Cmder icon: /icon "%CMDER_ROOT%\cmder.exe"
      • For Git icon: /icon "C:\Program Files (x86)\Git\etc\git.ico"
    • Commands (open Git's bash shell):
  • "C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%
@abhin4v
abhin4v / Calc.hs
Last active November 29, 2022 08:02
Simple Applicative Parser and Expression Calculator in Haskell
module Calc
( Expr(..)
, parse
, calculate
) where
import Control.Applicative
import Parser
data Expr = Add Expr Expr