Skip to content

Instantly share code, notes, and snippets.

View mosdevly's full-sized avatar

Mosdev mosdevly

  • San Francisco, CA
View GitHub Profile
@mosdevly
mosdevly / jenkins-notes.md
Created December 1, 2016 05:52 — forked from misterbrownlee/jenkins-notes.md
Jenkins setup

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

import os, sys
"""
grep -Rnw <pattern_file> <directory path>
"""
results = open('results.txt', 'w+')
pattern_file, dir_path = (sys.argv[1], sys.argv[2])
with open(pattern_file) as f:
for pattern in f:
@mosdevly
mosdevly / sounder.rb
Created June 27, 2016 21:55 — forked from jashkenas/sounder.rb
A Demonstration of Minim in Ruby-Processing
# Sounder sounds for class
# Requires an active microphone to pick up anything
require 'ruby-processing'
class MinimTest < Processing::App
load_library "minim"
import "ddf.minim"
import "ddf.minim.analysis"
@mosdevly
mosdevly / sessions.rb
Created December 27, 2015 23:08
Configure Bcrypt
# sessions_controller.rb
class SessionsController < ApplicationController
def new
# console
end
def create
user = User.find_by_email(params[:email])
if user && user.authenticate(params[:password])
session[:user_id] = user.id
@mosdevly
mosdevly / watchdog_linter.py
Created December 3, 2015 18:34
Run this in a shell session and it will monitor your files. Make sure to update the paths and file types as needed.
import logging
import re
import sys
import time
from subprocess import call
from watchdog.events import PatternMatchingEventHandler
from watchdog.observers import Observer
logger = logging.getLogger('watchdog.linter.python')
@mosdevly
mosdevly / keypress.rb
Created November 22, 2015 00:55 — forked from acook/keypress.rb
Read keypresses from user in terminal, including arrow keys using pure Ruby. This has since been folded into a much more robust gem called Remedy. https://rubygems.org/gems/remedy & https://github.com/acook/remedy
require 'io/console'
# Reads keypresses from the user including 2 and 3 escape character sequences.
def read_char
STDIN.echo = false
STDIN.raw!
input = STDIN.getc.chr
if input == "\e" then
input << STDIN.read_nonblock(3) rescue nil
@mosdevly
mosdevly / Web Form
Last active October 17, 2015 03:35
Web Form
Web Form
--------
An HTML, CSS and JS exercise for learning to create a form.
A [Pen](http://codepen.io/Protosac/pen/epedrr) by [Proto](http://codepen.io/Protosac) on [CodePen](http://codepen.io/).
[License](http://codepen.io/Protosac/pen/epedrr/license).
@mosdevly
mosdevly / Cookie Recipe
Last active October 17, 2015 03:36
Cookie Recipe
@mosdevly
mosdevly / HTML Basics 1.markdown
Created October 17, 2015 03:23
HTML Basics 1
@mosdevly
mosdevly / jenkins.sh
Last active August 29, 2015 14:27 — forked from dexterous/jenkins.sh
template jenkins/hudson build script for python with virtualenv
# WORKSPACE set to job workspace by jenkins/hudson
VENV="$WORKSPACE/.env"
if [ ! -e "$VENV" ]; then
virtualenv --python python2.6 --no-site-packages $VENV
elif [ ! -d "$VENV" ]; then
echo '$VENV exists but is not a directory'
exit 1
fi