Skip to content

Instantly share code, notes, and snippets.

@mithereal
mithereal / index.html
Created December 13, 2015 20:47
Search Github Cards via React.js
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js" data-semver="2.1.4" data-require="jquery@*"></script>
<script data-require="moment.js@*" data-semver="2.10.2" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
<link rel="stylesheet" href="style.css" />
</head>
<body>
@mithereal
mithereal / smartd.conf
Created February 7, 2016 18:59
smartmon settings
# Sample configuration file for smartd. See man smartd.conf.
# Home page is: http://smartmontools.sourceforge.net
# $Id: smartd.conf 3651 2012-10-18 15:11:36Z samm2 $
# smartd will re-read the configuration file if it receives a HUP
# signal
# The file gives a list of devices to monitor using smartd, with one
@mithereal
mithereal / QuickGit.php
Last active July 1, 2016 22:03 — forked from lukeocodes/QuickGit.php
Current git version.
<?php
class QuickGit {
private $version;
function __construct() {
if(function_exists('exec')) {
exec('git describe --always',$version_mini_hash,$error);
if($error == 0 ){
exec('git rev-list HEAD | wc -l',$version_number);
exec('git log -1',$line);
#!/bin/bash
## This script will observe a directory and compress/optimize .png and .jpg files
## Created to optimize incoming images on ubuntu / aws server
## jpegoptim, jpgcompress, pngquant and inotify-tools
## 2016 Jason Clark (mithereal@gmail.com)
DIRECTORY_TO_OBSERVE="/var/www/html/image/cache"
@mithereal
mithereal / verify.php
Last active February 2, 2017 22:06
test filezilla fites in filezilla.xml for validity
<?php
//this will test and validate your filezilla exported sites ie filezilla.xml file run this in the dir filezilla.xml is ie
//'php verify.php filezilla.xml' or
//'php verify.php filezilla.xml verify' to validate ftp details
//an html file called filezilla_status will contain the ftp info
$xml_file = $argv[1];
if(isset($argv[1] && $argv[1] == "verify")){
$test_ftp = true;
@mithereal
mithereal / Site.Plug.Bot.Seo
Last active June 23, 2017 18:35
route bots to a custom route so we can seed them with seo friendly content via plug
defmodule Site.Plug.Bot.Seo do
import Plug.Conn
@doc """
This plug will route bots to a custom route so we can seed them with seo friendly content
requires (add to mix): {:ua_inspector, "~> 0.13" }
"""
@url "/to_url"
def init(options), do: options
// Brunch automatically concatenates all files in your
// watched paths. Those paths can be configured at
// config.paths.watched in "brunch-config.js".
//
// However, those files will only be executed if
// explicitly imported. The only exception are files
// in vendor, which are never wrapped in imports and
// therefore are always executed.
// Import dependencies
@mithereal
mithereal / brunch-config.js
Created September 28, 2017 00:04
brunch config
exports.config = {
// See http://brunch.io/#documentation for docs.
files: {
javascripts: {
joinTo: {
"js/landing/vendor.js": /^(bundled\/js\/landing|vendor|deps|node_modules).*/,
"js/page/vendor.js": /^(bundled\/js\/page|vendor|deps|node_modules).*/,
"js/quote/vendor.js": /^(bundled\/js\/quote|vendor|deps|node_modules).*/,
@mithereal
mithereal / tile38.service
Created October 12, 2017 16:48
tile38 systemd script
[Unit]
Description=Advanced Geolocation store
After=network.target
Documentation=http://tile38.com/documentation/, man:redis-server(1)
[Service]
Type=forking
ExecStart=/srv/geodb/tile38-server
PIDFile=/var/run/tile38/tile38-server.pid
TimeoutStopSec=0
@mithereal
mithereal / filter.ex
Created January 3, 2018 17:06
elixir filter from a list
defmodule Filter do
@moduledoc """
this module will filter out results from a list via body or tail recursion
"""
@doc """
this will filter one result from the list via tail recursion
"""