Skip to content

Instantly share code, notes, and snippets.

View aosteraas's full-sized avatar

Aaron Osteraas aosteraas

  • Melbourne, Australia
View GitHub Profile
@aosteraas
aosteraas / app.js
Last active April 30, 2024 22:31
TeamCity Discord Bot
#!/usr/bin/env node
const Discord = require('discord.io');
const teamcity = require('teamcity');
const auth = require('../auth.json');
// Create Discord Bot
const bot = new Discord.Client({
token: auth.token,
autorun: true
});
'use strict';
const gulp = require('gulp');
const sass = require('gulp-sass');
const sourcemaps = require('gulp-sourcemaps');
const autoprefix = require('gulp-autoprefixer');
const notify = require('gulp-notify');
const concat = require('gulp-concat');
const order = require('gulp-order');
const uglify = require('gulp-uglify');
// I think the best way to show how the choice will influence what you do is in html
// Normally when writing HTML you would use double quotes for whatever classes/attributes you apply
// but here, in JS, we are starting the string with double quotes so we *must* use single quotes instead
var myElement = "<div class='class-something'></div>";
var myClass = "snd-nds";
// If you want to use a variable as the class name you need to use single quotes like we did before but then use
// concatenation to join it together
// ** **
var anotherElement = "<div class='" + myClass + "'></div>";
<?php
// Remove p tags from images
function remove_img_p_tag($content){
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
}
add_filter('the_content', 'remove_img_p_tag');
@aosteraas
aosteraas / imgcnf
Created September 3, 2012 23:42
scalable images in wordpress
img[class*="align"],
img[class*="wp-image-"] {
height: auto; /* Make sure images with WordPress-added height and width >attributes are scaled correctly */
}
img.size-full {
max-width: 97.5%;
width: auto; /* Prevent stretching of full-size images with height and >>width attributes in IE8 */
}
.gallery-caption {
font-size: .8em;
@aosteraas
aosteraas / MacBook Air problems #3
Created June 26, 2012 01:12
MacBook Air problems #3
Interval Since Last Panic Report: 541587 sec
Panics Since Last Report: 3
Anonymous UUID: 7F8B9B54-B6CF-4EAF-9EAE-3722ABBE1022
Tue Jun 26 11:11:00 2012
panic(cpu 0 caller 0xffffff80002c4794): Kernel trap at 0xffffff7f816939b1, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x0000008400001219, CR3: 0x0000000011e9a051, CR4: 0x00000000001606e0
RAX: 0xffffff7f81693a84, RBX: 0x0000000000000077, RCX: 0x0000008400001211, RDX: 0x0000000000c77695
RSP: 0xffffff8072d339b0, RBP: 0xffffff8072d339c0, RSI: 0xffffff80190f0200, RDI: 0xffffff801222b000
R8: 0xffffff807315c85c, R9: 0xffffff7f816ed380, R10: 0xffffff8072d3392c, R11: 0xffffff8072d33930
@aosteraas
aosteraas / MacBook Air problems #2
Created June 25, 2012 06:47
MacBook Air problems #2
Interval Since Last Panic Report: 495881 sec
Panics Since Last Report: 2
Anonymous UUID: 7F8B9B54-B6CF-4EAF-9EAE-3722ABBE1022
Mon Jun 25 16:46:17 2012
panic(cpu 3 caller 0xffffff80002c4794): Kernel trap at 0xffffff7f81694330, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x000001d200000014, CR3: 0x0000000052fec06b, CR4: 0x00000000001606e0
RAX: 0xffffff7f81694320, RBX: 0xffffff8010bbce00, RCX: 0xffffff7f816943f8, RDX: 0x0000000160f00557
RSP: 0xffffff809309b9a0, RBP: 0xffffff809309b9c0, RSI: 0xffffff8010bbce00, RDI: 0x000001d200000014
R8: 0x0000000000000000, R9: 0x0000000000000000, R10: 0xffffff7f81694e6c, R11: 0xffffff80101965e8
@aosteraas
aosteraas / MacBook Air problems
Created June 23, 2012 08:17
MacBook Air problems
Interval Since Last Panic Report: 345546 sec
Panics Since Last Report: 1
Anonymous UUID: 7F8B9B54-B6CF-4EAF-9EAE-3722ABBE1022
Sat Jun 23 18:16:15 2012
panic(cpu 0 caller 0xffffff80002c4794): Kernel trap at 0xffffff7f816a7d22, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x000000000000008c, CR3: 0x0000000161d18049, CR4: 0x00000000001606e0
RAX: 0x000000000000007c, RBX: 0xffffff806a5f2000, RCX: 0x00000000ffffffff, RDX: 0xffffff800bddea00
RSP: 0xffffff809296b970, RBP: 0xffffff809296b9b0, RSI: 0xffffff800c997200, RDI: 0xffffff800a3e7a50
R8: 0x000000004f800000, R9: 0xffffff800640fca8, R10: 0xffffff8016aaee50, R11: 0x0008000000137b5f
@aosteraas
aosteraas / php-5.4.4 make test
Created June 15, 2012 16:26
I found a problem in php apparently
You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it. You can then email it to qa-reports@lists.php.net later.
Do you want to send this report now? [Yns]: Y
<?php
$name = $_GET['name'];
echo 'Welcome to our website, ' .
htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . '!';
?>