Skip to content

Instantly share code, notes, and snippets.

@fillet54
fillet54 / gist:10002057
Last active August 29, 2015 13:58
Ghost deploy.cmd Deployment section
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------
:Deployment
echo Handling node.js grunt deployment.
:: 1. Select node version
call :SelectNodeVersion
@fillet54
fillet54 / gist:10003184
Created April 6, 2014 08:41
Ghost Config.js Production Section
// ### Production
// When running Ghost in the wild, use the production environment
// Configure your URL and mail settings here
production: {
url: 'http://WEBSITENAME.azurewebsites.net',
mail: {
transport: 'SMTP',
options: {
host: 'smtp.sendgrid.net',
port: 587,
@fillet54
fillet54 / gist:10746729
Created April 15, 2014 16:46
AppConfig
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.diagnostics>
<sources>
<source name="MyCompany.Application" switchValue="All">
<listeners>
<add initializeData="output.txt" type="LoggingTesting.SimpleTraceListener, LoggingTesting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
@fillet54
fillet54 / gist:10746761
Created April 15, 2014 16:47
SimpleTraceListener
using System;
using System.Collections;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Permissions;
namespace LoggingTesting
{
@fillet54
fillet54 / omglog.rb
Created January 20, 2012 19:41 — forked from pimeys/omglog.rb
omglog for linux
#!/usr/bin/env ruby
# coding: utf-8
require 'rb-inotify'
CLEAR = "\n----\n"
YELLOW, BLUE, GREY, HIGHLIGHT = '0;33', '0;34', '0;90', '1;30;47'
SHORTEST_MESSAGE = 12
LOG_CMD = %{git log --all --date-order --graph --color --pretty="format: \2%h\3\2%d\3\2 %an, %ar\3\2 %s\3"}
LOG_REGEX = /(.*)\u0002(.*)\u0003\u0002(.*)\u0003\u0002(.*)\u0003\u0002(.*)\u0003/
@fillet54
fillet54 / gist:8edf5c7e8e7d7fe4602b
Last active November 5, 2015 17:17
tcpdump to find GET
sudo tcpdump -s 0 -A 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'
@fillet54
fillet54 / sample.groovy
Created January 10, 2016 10:14
Mapping CSV to Other Formats
def sampleSpecCSV = '''field name, description, units, range
Item1, The first item, feet, 100..200
Item2, The second item, meters, 1000.000..2000.000
Item3, Enumeration field, enum, MANUAL:AUTOMATIC
Item4, Some string, string(10),
'''
def fieldMappingCSV = '''field name, path, units, enum mapping
Item1, field1, feet,
Item2, nested1.field1, feet,
@fillet54
fillet54 / bitbucket-cloud-menu.user.js
Created January 24, 2016 20:15
Userscript to add links to Bitbucket Cloud's app switcher menu to make it consistent with other Atlassian Products
// ==UserScript==
// @name Bitbucket Cloud Menu
// @namespace http://philgomez.com
// @include https://bitbucket.org/*
// @version 1.2
// ==/UserScript==
//
function runWithJQuery(callback) {
var script = document.createElement("script");
#!/usr/bin/python
import sys, getopt, time, re, random, os, socket
int_len = len(str(0xFFFFFFFFFFFFFFFF))
def run_client(host, port):
count = 0
order = 0
dropped = 0
@fillet54
fillet54 / machine.js
Last active June 6, 2020 07:22
Passthrough Without A Timeout Event
const MAX_RETRIES = 3
const retryExpired = (context, event) => context.retries >= MAX_RETRIES
const passthroughMachine = Machine({
id: 'passthrough',
initial: 'send_request',
context: {
retries: 0
},
states: {