Skip to content

Instantly share code, notes, and snippets.

//- As you may know, Laravel 5 provides the Elixir to compile assets with no pain.
These mixins is for those of you who want to use Jade power combined with that of Laravel Blade.
The syntax mimic Blade statements, however identation differs in some cases.
- var newline = "\r\n"
- var loopIterator = '$iterator'
//- @extends mixin
Example: +extends('layouts/master')
Compiled: @extends('layouts/master')
@codeyash
codeyash / gist:90e15d9a78e2c9c45cd0
Created April 2, 2015 18:09
Using variables from project file (.pro) into C++ code
http://qtway.blogspot.in/2013/04/using-variables-from-project-file-pro.html
Have you ever wonder if any of the variables you have defined in your project file (.pro) can be used in your C++ source code? The answer is yes, and the process is straightforward.
Let's say you export the variables in the project file as macros (in this case you set the target name for the application), then using it from C++ is just simple.
In the project file (.pro)
TARGET = YourApp
TEMPLATE = app
DEFINES += TARGET=\\\"$TARGET\\\"
<?php
class DocBlock {
public $docblock,
$description = null,
$all_params = array();
/**
* Parses a docblock;
/**
* @brief executeQueriesFromFile Read each line from a .sql QFile
* (assumed to not have been opened before this function), and when ; is reached, execute
* the SQL gathered until then on the query object. Then do this until a COMMIT SQL
* statement is found. In other words, this function assumes each file is a single
* SQL transaction, ending with a COMMIT line.
*/
void executeQueriesFromFile(QFile *file, QSqlQuery *query)
{
@codeyash
codeyash / 0_reuse_code.js
Created August 21, 2014 12:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/**
* @brief copyDir
* @param src
* @param dest
* @return bool
*
* Authors: wysota , Yash
* http://kineticwing.com
*
* License Apache 2.0
#!/usr/bin/sh
rm -rf "$HOME/Library/Preferences/WebIde40"
rm -rf "$HOME/Library/Caches/WebIde40"
rm -rf "$HOME/Library/Application Support/WebIde40"
rm -rf "$HOME/Library/Logs/WebIde40"
<?php
Quota::with(
array(
'codes' => function($query) {
$query->where('number', '=', 11);
}
)
)
->where('label', '=', 'foo')
<!-- Example on how to set class="active" on active navigation links -->
<!-- These links will always be visible -->
<li class="{{ URI::is( 'home') ? 'active' : '' }}">
<a href="{{ URL::to( 'home') }}">
Home
</a>
</li>
<li class="{{ URI::is( 'gallery') ? 'active' : '' }}">
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
(($, window) ->