Skip to content

Instantly share code, notes, and snippets.

@ra2003
ra2003 / SourceCodeSearchEngines.md
Created July 17, 2020 11:12 — forked from phillipalexander/SourceCodeSearchEngines.md
Source Code Search Engines You Can Use For Programming Projects

Source Code Search Engines

NOTE: This list is almost entirely copy/pasted from THIS awesome article. I've made my own personal edits (adding some additional content) which is why I keep it here.

Every day meanpath crawls over 200 million websites capturing the visible text, HTML source code, CSS and Javascript. This information is used by many companies to monitor the growth of web facing technology.

@ra2003
ra2003 / reset_db.py
Created July 11, 2020 16:42 — forked from amaudy/reset_db.py
Python+psycopg2 for drop all tables of database you given.
#!/usr/bin/env python
import psycopg2
import sys
"""
Drop all tables of database you given.
"""
try:
@ra2003
ra2003 / xml_split.py
Created July 8, 2020 18:44 — forked from benallard/xml_split.py
Small python script to split huge XML files into parts. It takes one or two parameters. The first is always the huge XML file, and the second the size of the wished chunks in Kb (default to 1Mb) (0 spilt wherever possible) The generated files are called like the original one with an index between the filename and the extension like that: bigxml.…
#!/usr/bin/env python
import os
import xml.parsers.expat
from xml.sax.saxutils import escape
from optparse import OptionParser
from math import log10
# How much data we process at a time
@ra2003
ra2003 / ckedit.py
Created June 20, 2020 12:49 — forked from mrjoes/ckedit.py
Flask-Admin and CKEditor WYSIWYG textarea integration. Basically, all you have to do: 1. Create new wtforms widget which will emit 'ckeditor' class 2. Make new wtforms field which will use this widget 3. Create new jinja2 template, which includes ckeditor javascript 4. Tell flask-admin to use new field and new template
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin, wtf
from flask.ext.admin.contrib import sqlamodel
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.sqlite'
db = SQLAlchemy(app)
import pytesseract
import sys
import argparse
try:
import Image
except ImportError:
from PIL import Image
from subprocess import check_output
@ra2003
ra2003 / composing-software.md
Created June 13, 2020 12:16 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
@ra2003
ra2003 / build_index.py
Created June 10, 2020 11:00 — forked from DM-/build_index.py
Very basic text indexer/searcher in Python
import sys, os, glob, re, pickle
if len(sys.argv) != 2:
print "USAGE: %s DIR" % sys.argv[0]
sys.exit(1)
DIR = sys.argv[1]
INDEX = {}
FILES = []
#!/usr/bin/python
import socket
import struct
import sys
# We want unbuffered stdout so we can provide live feedback for
# each TTL. You could also use the "-u" flag to Python.
class flushfile(file):
def __init__(self, f):
@ra2003
ra2003 / gulpfile.js
Created June 2, 2020 21:10
gulpfile LESS assembly
const gulp = require("gulp"),
autoprefixer = require("gulp-autoprefixer"),
cleanCSS = require("gulp-clean-css"),
sourcemaps = require("gulp-sourcemaps"),
gcmq = require("gulp-group-css-media-queries"),
lessC = require("gulp-less"),
imagemin = require("gulp-imagemin"),
uglify = require("gulp-uglify"),
concat = require("gulp-concat"),
rename = require("gulp-rename"),