This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo ">>> Starting Install Script" | |
# Update | |
sudo apt-get update | |
# Install MySQL without prompt | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main.m | |
// creategif | |
// | |
// Created by Kevin Meaney on 21/10/2013. | |
// I've briefly blogged about it here: | |
// http://blog.yvs.eu.com/2013/10/creating-gif-animations-using-coreimagequartz | |
// The following code is all that is all the code needed for a creating a command line tool to generate | |
// a gif animation from image files. | |
// The main limitation with this code is that apart from the frame delay time of 0.1 second, every |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Symbolic Press is a helper to help you use your WordPress plugins with Symbolic Links. | |
* | |
* Read more about it on: | |
* @link http://www.gayadesign.com/diy/using-wordpress-plugins-as-symbolic-links/ | |
*/ | |
class Symbolic_Press { | |
public $plugin_path; | |
public $plugin_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- use it like this. Please notice that nohtml filter was used before newlines. --> | |
<p ng-bind-html-unsafe="post.content | nohtml | newlines"></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Mongoose Paginate plugin | |
Forked from: | |
https://gist.github.com/craftgear/1525918 | |
This snippet is inspired by edwardhotchkiss's mongoose-paginate | |
(https://github.com/edwardhotchkiss/mongoose-paginate) | |
and works with any methods like where, desc, populate, etc. | |
The `paginate` method must be called at the end of method chains. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var objectToQueryString = function (a) { | |
var prefix, s, add, name, r20, output; | |
s = []; | |
r20 = /%20/g; | |
add = function (key, value) { | |
// If value is a function, invoke it and return its value | |
value = ( typeof value == 'function' ) ? value() : ( value == null ? "" : value ); | |
s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value); | |
}; | |
if (a instanceof Array) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo port -v install mysql5-server | |
# Don't do any post-install instructions | |
sudo -u _mysql mysql_install_db5 | |
# if above command produce this error: ERROR: 1004 Can't create file '/var/tmp/#sqle967_1_0.frm' (errno: 9) | |
# do this: | |
# sudo chown -R mysql:mysql /opt/local/var/db/mysql5 | |
# sudo chmod u+rwx,go= /opt/local/var/db/mysql5 | |
# sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LOOCryptString.h | |
// | |
// Created by Marcin Swiderski on 6/8/12. | |
// Copyright (c) 2012 Marcin Swiderski. All rights reserved. | |
// | |
// This software is provided 'as-is', without any express or implied | |
// warranty. In no event will the authors be held liable for any damages | |
// arising from the use of this software. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
m_SideBarTexture = CreateTexture (CreateColor ("#30433C")); | |
// The goodness: | |
static Color CreateColor (string hexCode, float alpha = 1.0f) | |
{ | |
if (hexCode.Length == 7 && hexCode[0] == '#') | |
{ |
NewerOlder