Skip to content

Instantly share code, notes, and snippets.

View kevinruscoe's full-sized avatar
💻
Working

Kevin Ruscoe kevinruscoe

💻
Working
View GitHub Profile
@kevinruscoe
kevinruscoe / select2.js
Last active August 29, 2015 14:26
select2 with search field if not found!
$(".select2").select2({
// theme: "my-theme",
placeholder: function(){
$(this).data('placeholder');
},
maximumSelectionSize: 5,
templateResult: function(item) {
if( item._resultId === undefined ){
return ["Search for <b>'" + item.text + "'<b>"];
@kevinruscoe
kevinruscoe / after.sh
Last active August 29, 2015 14:26 — forked from cluppi/after.sh
Turning SSL on for Homestead
#!/bin/sh
# Config for SSL.
echo "--- Making SSL Directory ---"
mkdir /etc/nginx/ssl
echo "--- Copying $i SSL crt and key ---"
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com"
echo "--- Turning SSL on in nginx.conf. ---"
@kevinruscoe
kevinruscoe / query.sql
Created July 31, 2015 16:08
Move WP to new domain
/* Begin Here */
UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_url = replace(link_url, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_image = replace(link_image, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
/*UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl' OR option_name = 'widget_text' OR option_name = 'dashboard_widget_options';*/
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com');
@kevinruscoe
kevinruscoe / bs.sass
Created June 16, 2015 14:34
bootstrap media query mixin
@mixin respond-above( $media ) {
@if $media == lg {
@media( min-width: $screen-lg-min ) {
@content;
}
}
@else if $media == md {
@media( min-width: $screen-md-min ) {
@content;
$primary-color: $purple;
@function text-color($inverted: true){
@if (lightness($primary-color) > 50 and $inverted == false) {
@return #444;
} @else {
@return #fff;
}
}
// https://gist.github.com/kevdotbadger/2de20b08627ac32ebb5e
$flat-turquoise: #1abc9c;
$flat-emerland: #2ecc71;
$flat-peter-river: #3498db;
$flat-amethyst: #9b59b6;
$flat-wet-asphalt: #34495e;
$flat-green-sea: #16a085;
$flat-nephritis: #27ae60;
$flat-belize-hole: #2980b9;
$flat-wisteria: #8e44ad;
@kevinruscoe
kevinruscoe / bower.json
Last active June 6, 2021 08:58
Compile SASS and Compress JS into single file
{
"name": "App",
"version": "1",
"authors": [
"Kevin Ruscoe <[email protected]>"
],
"moduleType": [
"node"
],
"license": "MIT",
<?php
function average( $values ){
return;
}
echo average(array(1, 5, 8, 34, 7, 20, 20));
@kevinruscoe
kevinruscoe / wordpress-editor.scss
Last active November 2, 2023 18:55
Sass default WordPress editor styles.
/**
* WordPress WYSIWYG Editor Styles
*
* Some nice SCSS styles. Fixes the alignment left/right issues when using them in the editor.
* There's a load of more 'defaults' over at http://digwp.com/2010/05/default-wordpress-css-styles-hooks/
* which is where this was original 'borrowed' from. Cheers Jeff Starr (@perishable)!
*
* @author Kevin Ruscoe (@kevdotbadger)
* @link http://digwp.com/2010/05/default-wordpress-css-styles-hooks/ Original author
* @link https://twitter.com/perishable Twitter of original author
// jquery sortable for team / gallery priority ordering
$(function() {
var container = $('.sortable-container');
//* user resorts list
container.sortable({
update: function( event, ui ) {
update_via_ajax();
}
});
//* remove item from list