Skip to content

Instantly share code, notes, and snippets.

View wordswords's full-sized avatar

David Craddock wordswords

View GitHub Profile
@wordswords
wordswords / gist:7117346
Created October 23, 2013 12:03
Exercise Start Text
<!DOCTYPE html>
<html>
Text Editing Example</title>
</head>
<head>
<h3>Plain text files vs. word processor files</h>
<pThere are important differences between plain text files created by a text editor and document files created by word processors such as Microsoft Word, WordPerfect, and OpenOffice.org.</p>
<ul>
<li>A plain text file uses a simple <a href "http://en.wikipedia.orghttp://en.wikipedia.org/wiki/Character_set" title="Character set">character set</a> such as <a href="http://en.wikipedia.org/wiki/ASCII" title="ASCII">ASCII/a> to represent numbers, letters, and a small number of symbols. The only <a href="http://en.wikipedia.org/wiki/Control_character" title="Control character">non-printing characters</a> in the file that can be used to format the text, are newline, tab, and formfeed.
<liWord processor documents generally contain <a href="http://en.wikipedia.org/wiki/Formatted_text" title="Formatted text">formatted text</a>, such as enabling text to appear in boldface and italics, to use multiple <hre
File 1:
module MyModule
class ClassOne
...
end
end
File 2:
@wordswords
wordswords / gist:5db47a8561383b9edf9a
Created October 8, 2014 15:15
hive scheduler error
I 2014-10-08 16:14:23: Worker loop aborted: JSON::ParserError
I 2014-10-08 16:14:29: Worker loop aborted: 795: unexpected token at '<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Action Controller: Exception caught</title>
<style>
body {
background-color: #FAFAFA;
color: #333;
require 'action_view'
include ActionView::Helpers::DateHelper
require 'date'
starttime = DateTime.new(2014, 6, 2, 6, 6, 6)
endtime = DateTime.new(2016, 6, 2, 1, 1, 1)
wordy_time = ActionView::Helpers::DateHelper.distance_of_time_in_words(starttime, endtime)
# david@David-Craddocks-MBP ~/w/bug-in-action-view> bundle exec ruby bug_in_action_view.rb
#/Users/david/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionview-4.2.6/lib/action_view/helpers/date_helper.rb:111:in `block in distance_of_time_in_words': undefined method `acts_like?' for 2014-06-02 07:06:06 +0100:Time (NoMethodError)
// doesn't follow redirects
function HTTPRequest(url){
};
HTTPRequest.prototype.request = function(url){
var request = require('request');
return result = request(url, function (error, response, body){
if (!error) {
return body;
}
var logger = new winston.Logger({
level: 'info',
transports: [
new (winston.transports.Console)(),
new (winston.transports.File)({ filename: 'somefile.log' })
]
});
PROJECT_ID=170
JOB_SIZE=10
VERSION=`date "+%y%m%d"`
CERT=/opt/certs/live.pem
CA=/opt/certs/ca-bundle.pem
echo Version: $VERSION
curl -1 --cert $CERT --cacert $CA https://hive.cloud.bbc.co.uk/api/batches --form name="TVAPI Control Tests" --form execution_variables[spec_file]="" --form version=$VERSION --form project_id=$PROJECT_ID --form tests_per_job=$JOB_SIZE -v
@wordswords
wordswords / del.sh
Last active September 11, 2017 16:11
1
sudo -H -u llvm-test bash -c "shopt -s dotglob && /usr/bin/nice -15 /usr/bin/find /home/llvm-test/tests -mindepth 1 -mtime +14 -type f -name '*' -delete && /usr/bin/nice -15 /usr/bin/find /home/llvm-test/tests -mindepth 1 -mtime +14 -type d -name '*' -delete && shopt -u dotglob;"
2
for testpath in "/home/llvm-test/tests/shoji/Results_History" "/home/llvm-test/tests/batchgen/BatchGen/Results" "/home/llvm-test/tests/batchgen/BatchGen/Failed_Results" "/home/llvm-test/tests/shoji/Data/17*" "/home/llvm-test/tests/shoji/Dsc/17*"; do
sudo -H -u llvm-test bash -c "shopt -s dotglob && /usr/bin/nice -15 /usr/bin/find $testpath -mindepth 1 -mtime +14 -type f -name '*' -delete && /usr/bin/nice -15 /usr/bin/find $testpath -mindepth 1 -mtime +14 -type d -name '*' -delete && shopt -u dotglob;"
done
import yaml
from os.path import expanduser
home = expanduser("~")
my_config = open(home + '/.secrets/codingmode/secrets.d/hue.yml')
my_config_dict = yaml.load(my_config.read(), Loader=yaml.FullLoader)
result = map(lambda x : x['Prompt'] # return prompt associated with variable \
if x['Variable'] \
== 'user_email' \
else \
@wordswords
wordswords / gist:429a76025866db4a347fbef7fa29fa54
Created February 2, 2021 13:35
no-cert-verify fix for python2.7 on floobits-neovim plugin
From e78519a6b01c326a7d9b563ad07188358ecce699 Mon Sep 17 00:00:00 2001
From: David Craddock <contact@davidcraddock.net>
Date: Tue, 2 Feb 2021 12:23:10 +0000
Subject: [PATCH] Workaround for no-cert-verify issue with python2.7
This skips the verification of the supplied server certificate.
It enables the plugin to be used again but creates a security
issue in that the server cert is not verified.
---
rplugin/python/floobits/common/api.py | 6 +++++-