Skip to content

Instantly share code, notes, and snippets.

View TheFrostlixen's full-sized avatar

Matt Fredrickson TheFrostlixen

View GitHub Profile
@matthewjberger
matthewjberger / Extract.cs
Last active March 14, 2018 00:29
Extract Image from pdf
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using iTextSharp.text.pdf;
using iTextSharp.text.pdf.parser;
using Tesseract;
using System.Drawing.Imaging;
namespace ExtractInvoice
@briandeheus
briandeheus / punk.py
Last active April 1, 2022 02:53
Don't be a punk, punk
import binascii
import struct
class Punk(object):
_END_CHUNK_TYPE = 'IEND'
_PUNK_CHUNK_TYPE = 'puNk'
_MAX_BYTES = 2147483647
_chunks = dict()
@benmarwick
benmarwick / PDF-2-text-or-CSV.r
Last active July 18, 2022 03:48
Convert PDFs to text files or CSV files (DfR format) with R
# Here are a few methods for getting text from PDF files. Do read through
# the instructions carefully! NOte that this code is written for Windows 7,
# slight adjustments may be needed for other OSs
# Tell R what folder contains your 1000s of PDFs
dest <- "G:/somehere/with/many/PDFs"
# make a vector of PDF file names
myfiles <- list.files(path = dest, pattern = "pdf", full.names = TRUE)
@SaswatPadhi
SaswatPadhi / polyglot.pl.php.py.rb.cpp
Created June 5, 2012 03:33 — forked from wakhub/polyglot.pl.php.py.rb
PHP + Perl + Python + Ruby + C + C++ - polyglot
#/*<?php eval('echo "PHP Code\n";'); __halt_compiler();?> */
#include <stdio.h> /*
print ((("b" + "0" == 0) and eval('"Perl Code\n"')) or (0 and "Ruby Code\n" or "Python Code"));
__DATA__ = 1
"""""
__END__
@meadhikari
meadhikari / kantipur.py
Created March 17, 2012 19:28
Pdf downloader
import datetime
#import urllib2
import re
import os
from pyPdf import PdfFileWriter, PdfFileReader
from urllib2 import Request, urlopen
from StringIO import StringIO
#date in the url format
now = datetime.datetime.now()
@jaytaylor
jaytaylor / dbhelper.py
Created March 13, 2012 18:12
Python Database Helper
import MySQLdb
##
# @author Jay Taylor [@jtaylor]
# @date 2010-11-15
#
# @description This is a basic database helper script which will setup the connection.
#
# @requirements The MySQLdb package must be installed, i.e. `sudo easy_install MySQLdb`
#
@mblondel
mblondel / perceptron.py
Last active April 21, 2024 13:42
Kernel Perceptron
# Mathieu Blondel, October 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
def linear_kernel(x1, x2):
return np.dot(x1, x2)
def polynomial_kernel(x, y, p=3):
@endolith
endolith / Has weird right-to-left characters.txt
Last active May 16, 2024 00:12
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶