Skip to content

Instantly share code, notes, and snippets.

@valotas
valotas / index.html
Last active August 15, 2018 10:22
RxJs Marble testing
<!DOCTYPE html>
<html>
<head>
<script src="https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.KitchenSink.umd.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/boot.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
@GreatPotato
GreatPotato / gist:9366899
Created March 5, 2014 13:13
Customize flash messages in LemonStand
<?php
class Advantage {
public static function show_error()
{
if (array_key_exists('system', Phpr::$session->flash->flash))
{
$system_message = Phpr::$session->flash['system'];
@GreatPotato
GreatPotato / my_module.php
Last active January 4, 2016 05:39
Adds top spending and top ordering customers widget to the dashboard
public function listDashboardReports()
{
return array(
'top_customers_revenue'=>array('partial'=>'top_customers_revenue.htm', 'name'=>'Top spending customers'),
'top_customers_orders'=>array('partial'=>'top_customers_orders.htm', 'name'=>'Top ordering customers')
);
}
@GreatPotato
GreatPotato / gist:5445303
Last active July 27, 2016 11:00
Gets the security details of a LS installation (including encryption key)
<?php
print_r( Phpr_SecurityFramework::create()->get_config_content() );
?>
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@simX
simX / hidpi.txt
Created July 28, 2012 04:58
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.