Skip to content

Instantly share code, notes, and snippets.

View kenju254's full-sized avatar

Kenneth Kinyanjui kenju254

View GitHub Profile
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /html/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /html/index.php [L]
</IfModule>
@kenju254
kenju254 / README.md
Created September 23, 2015 08:55 — forked from denji/README.md
Remove WebStorm; PhpStorm; PyCharm; RubyMine; AppCode; CLion, IntelliJ; 0xDBE10 settings and cli-links from Mac OSX

Quick uninstall JetBrains settings:

curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
@gaspanik
gaspanik / phpmyadmin.md
Created September 30, 2012 14:49
Install: Install phpMyAdmin on 10.8.x

Installing phpMyAdmin by Homebrew

HomebrewでphpMyAdminを入れる方法

※OS Xの中のApacheとPHPを動かして、MySQLをHomebrewで入れてる前提

それがまだなら、まずは以下を

Apache+PHP+MySQL(Homebrew) on Mountain Lion https://gist.github.com/3806975

HomebrewでPHPのあれこれを追加できるように

@chenigodwin
chenigodwin / Automated traffic data collection Algorithm,Godwin Micheni 5th Year,Civil Engineering, DeKUT
Last active October 14, 2015 06:10
Dedan Kimathi University,5th year project.Automatic Traffic Data Collection and Analysis Using Optical Camera and Sensor Image Recognition
% PART A
%linking camera with rasperry pi
%creating a camera board object
clear rpi;
rpi= raspi();
cam = cameraboard(rpi,'Resolution','640x480');
%PART B
% code to start the camera and to capture image
Clear all
Close all
@kn9ts
kn9ts / grammer.expression.py
Created December 6, 2015 07:24
An example of defining a programming language grammer
# Expanding Exp
# This is very, very difficult.
grammar = [
("exp", ["exp", "+", "exp"]),
("exp", ["exp", "-", "exp"]),
("exp", ["(", "exp", ")"]),
("exp", ["num"]),
]
@fmasanori
fmasanori / gist:4126471
Created November 21, 2012 17:55
Python Reddit MongoDB Client
import json
import urllib
import pymongo
con = pymongo.Connection('mongodb://localhost',
safe = True)
db = con.reddit
stories = db.stories
url = 'http://www.reddit.com/r/Python/.json'
@bbengfort
bbengfort / big_tweet_import.py
Last active December 28, 2015 18:41
Import and wrangling of the Big Tweet Dump from @murphsp1.
#!/usr/bin/env python
# big_tweet_import
# Imports the tweet-dump into MongoDB
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Thu Aug 28 07:37:41 2014 -0400
#
# Copyright (C) 2014 Bengfort.com
# For license information, see LICENSE.txt
#
@jboynyc
jboynyc / topsy-scraper.py
Last active February 16, 2016 13:33
This is a short Python script to scrape data from Topsy through their API and store it in MongoDB. (Now they require an API key, so some changes are necessary to get it to work.)
#!/usr/bin/env python
from urllib2 import urlopen, urlencode
from pymongo import connection
import json
from optparse import OptionParser
from time import sleep
verbose = 1
parser = OptionParser()
@waleoyediran
waleoyediran / jinja2backend.py
Last active July 20, 2016 11:58 — forked from carljm/jinja2backend.py
Adding support for context processors for Jinja2 templates in Django
import sys
import six
from django.template.backends.jinja2 import Jinja2, Template
from django.template.backends.utils import csrf_token_lazy, csrf_input_lazy
from django.template.exceptions import TemplateDoesNotExist
from jinja2.exceptions import TemplateSyntaxError
from jinja2.utils import import_string
import jinja2
@0m15
0m15 / mongo_chunk.py
Last active March 7, 2018 19:42
Python script that can export Mongo collections of any size into progressive numbered json chunks, type `python mongo_chunk.py --help` to have a list of available options
#!/usr/bin/python
import argparse
from pymongo import MongoClient as Client
from bson import BSON
from bson import json_util
import json
import os
# mongo client