Skip to content

Instantly share code, notes, and snippets.

/**
* Tests to run
* - what does it do if there are no markets attatched to the study
* - state.components.prediction_markets works correctly
*/
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
//proj.js
var header = document.querySelector('h2');
header.textContent = 'Order North Georgia Coffee';
//index.html
<html>
<head>
@peb7268
peb7268 / wordpress: remove autop
Created September 25, 2013 15:05
removing auto p wordpress
remove_filter ('the_content','wpautop');
remove_filter ('the_excerpt','wpautop');
@peb7268
peb7268 / functions.php
Created May 29, 2013 00:11
WordPress: get theme directory in content editor - Shortcode
function get_theme_dir(){
$dir = get_bloginfo('stylesheet_directory');
return $dir;
}
add_shortcode('get_theme_dir', 'get_theme_dir');
@peb7268
peb7268 / testem.yml
Created May 1, 2013 15:33
testem setup
launchers:
integration:
command: "rspec testing/integration"
headless:
command: "HEADLESS=1 rspec testing/integration"
src_files:
- testing/integration/*.rb
- app/webroot/js/src/global.js
test_page: app/webroot/js/SpecRunner.html
launch_in_dev:
@peb7268
peb7268 / gist:5438243
Created April 22, 2013 20:27
bash: mysql auto dump
NOW=$(date '+%m_%d_%Y_%s')
DBS=`cat /bu/dbs.out`
#DBS="$(mysql -u root -h localhost -ppassword -Bse 'show databases')"
for db in $DBS
do
FILE=${db}_${NOW}.gz
OLDFILE=${db}_*.gz
#rm -f /bu/$OLDFILE
mysqldump -u root -h localhost -pronky $db | /bin/gzip -9 > /bu/$FILE
done
@peb7268
peb7268 / index.php
Created April 22, 2013 14:57
wordpress: plugin header
<?php
/*
Plugin Name: Imperative Sales Tracker
Plugin URI: http://www.imperativedesign.net/plugins/sales-tracker-plugin
Description: A cool tool to help you track and reach your goals
Version: 0.5
Author: Paul Barrick
Author URI:http://www.imperativedesign.net
*/
@peb7268
peb7268 / iframe
Created April 19, 2013 20:09
html: iframe
<iframe src="http://www.yoursite.com"
width="400" height="300" marginwidth="0" marginheight="0"
hspace="0" vspace="0" frameborder="0" scrolling=yes>
</iframe>
@peb7268
peb7268 / package.json
Created April 17, 2013 17:23
grunt: package.json
{
"name": "my-project-name",
"version": "0.1.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.1.1",
"grunt-contrib-nodeunit": "~0.1.2"
}
}
@peb7268
peb7268 / media-query-syntax
Created April 10, 2013 16:08
css:media-query
//improve the layout
@media all and (max-width: 875px){
body { background: blue; }
}