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
-- Splits username by first space, shortens first name to the first letter & adds a dot. Ex.: Jonh Smith -> J. Smith | |
SELECT CONCAT(CONCAT(LEFT(SUBSTRING_INDEX(SUBSTRING_INDEX( `username` , ' ', 2 ),' ',1),1),"",". ") ," ", SUBSTRING_INDEX(SUBSTRING_INDEX( `username` , ' ', -1 ),' ',2)) AS user | |
FROM tbl_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
# highighting grep | |
grep --color -E "string" file |
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 casper = require('casper').create(); | |
casper.start(); | |
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)'); | |
casper.viewport(1024, 768); | |
casper.thenOpen('http://jsbin.com/ifuma#noedit', function() { | |
this.capture('test.png'); |
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
// taken from : http://forums.laravel.io/viewtopic.php?id=839 | |
class Blog_Controller extends Controller | |
{ | |
public $layout = 'layouts.default'; | |
public function action_index() | |
{ | |
$this->layout->title = "Blog"; |
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
module.exports = { | |
login: function(casper, url, user, password, cont) { | |
if (cont === undefined) { | |
casper.start(url, function() { | |
this.test.info('Logging in user: ' + user); | |
this.fill('#login-form', { | |
'email-login': user, | |
'password-login': password |
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
module.exports = function(grunt) { | |
// 'use strict' | |
grunt.initConfig({ | |
sass: { | |
dist: { | |
files: { | |
'css/prezenter.css': 'sass/prezenter.scss' | |
} | |
}, |
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
// https://gist.github.com/garyharan/957284 | |
@mixin box-shadow($top, $left, $blur, $color, $inset: false) { | |
@if $inset { | |
-webkit-box-shadow:inset $top $left $blur $color; | |
-moz-box-shadow:inset $top $left $blur $color; | |
box-shadow:inset $top $left $blur $color; | |
} @else { | |
-webkit-box-shadow: $top $left $blur $color; | |
-moz-box-shadow: $top $left $blur $color; | |
box-shadow: $top $left $blur $color; |
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
# Original source at: http://angularjs.org/#todo-js | |
window.TodoCtrl = ($scope) -> | |
$scope.todos = [ | |
{text: 'learn angular', done: true}, | |
{text: 'build an angular app', done: false} | |
] | |
$scope.addTodo = -> |
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
// Make our app module, its easier to do this in raw javascript | |
// and then put the rest of our app content (controllers etc) | |
// in their own coffeescript files. | |
// | |
// Your ng-app should include this module name, eg: <html ng-app="TodoApp"> | |
angular.module('TodoApp', []); |
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
img{ | |
max-width:100%; | |
height:auto; | |
} |