Skip to content

Instantly share code, notes, and snippets.

@zrks
zrks / log_finder.py
Last active October 8, 2015 10:19
simple .log file locator
import os
import stat
count = 0
def file_not_empty(root, file):
if os.stat(os.path.join(root, file))[stat.ST_SIZE] > 0:
return file
@zrks
zrks / .vimrc
Last active November 12, 2017 16:37
here I will store any custom configs for vim
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize.
set rtp+=~/.vim/bundle/Vundle.vim
" call vundle#begin()
" alternatively, pass a path where Vundle should install plugins.
"call vundle#begin('~/some/path/here')
from pprint import pprint
import pygame
class GamePiece:
def __init__(self):
self.checked = False
@zrks
zrks / log_reader.py
Last active January 15, 2016 11:31
log_reader.py
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
class MyHandler(FileSystemEventHandler):
def __init__(self):
self.last_line_count = 0
{
"twopac" : {
"greatest_song" : "California Love",
"greatest_album" : "Me against the world",
"quotes" : [{"song" : "Hit em up",
"line" : "Killing ain't fair, but somebody's got to do it."}]
},
"eminem" : {
"greatest_song" : "Berzerk",
"greatest_album" : "Infinite",
@zrks
zrks / test-jira.py
Last active April 1, 2016 08:38
Sample Jira ticket status change.
import os
from jira import JIRA
# http://jira.readthedocs.org/en/latest/#quickstart
from git import Repo
# http://gitpython.readthedocs.org/en/stable/tutorial.html
from settings import * # Add your own settings file!
@zrks
zrks / hadolint.png
Last active June 30, 2016 09:48
Hooks demonstration
hadolint.png
@zrks
zrks / generate.py
Last active February 1, 2017 10:59
jinja2 Templating Primer
"""
For full reference check: http://jinja.pocoo.org/docs/2.9/api/
"""
import logging
import json
import yaml
from jinja2 import Environment, FileSystemLoader, select_autoescape
@zrks
zrks / Jenkinsfile
Last active December 28, 2017 06:33
DevOps for powerpoint
pipeline {
agent {
label "master"
}
environment {
CONFIGURATION_FILENAME = "presentation.yml"
PRESENTATION_NAME = "devops-for-powerpoint.pptx"
}
package com.example.marcis.myapplication.feature;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;