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
def subscribe(id, email, merge_vars=nil, email_type='html', double_optin=true, update_existing=false, replace_interests=true, send_welcome=false) | |
_params = {:id => id, :email => email, :merge_vars => merge_vars, :email_type => email_type, :double_optin => double_optin, :update_existing => update_existing, :replace_interests => replace_interests, :send_welcome => send_welcome} | |
return @master.call 'lists/subscribe', _params | |
end |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
actions: { | |
updateUser: function(){ | |
const flashMessages = Ember.get(this, 'flashMessages'); | |
this.get('model').save().then(function(){ | |
flashMessages.success('Your profile was saved correctly!'); | |
}, function(response) { | |
flashMessages.danger('Something went wrong!'); |
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
auto lo | |
iface lo inet loopback | |
auto eth0 | |
iface eth0 inet static | |
address 10.1.2.3 | |
netmask 255.255.255.0 | |
gateway 10.1.2.1 |
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
/** | |
* Custom validation for the customer_profile_billing checkout pane. | |
*/ | |
function arkaos_glue_commerce_checkout_form_validate($form, &$form_state, $checkout_pane, $order) { | |
$valid = TRUE; | |
// check vat | |
$vat = $form_state['values']['customer_profile_company_info']['field_vat_number']['und'][0]['vat_number']; | |
$country = $form_state['values']['customer_profile_billing']['commerce_customer_address']['und'][0]['country']; | |
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
from sqlalchemy import Column, DateTime, String, Integer, ForeignKey, func | |
from sqlalchemy.orm import relationship, backref | |
from sqlalchemy.ext.declarative import declarative_base | |
import os | |
import sys | |
Base = declarative_base() | |
from falcon_mvc.database import db_session |
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
class Product < StatisticsModel | |
has_one :active_sale, :class_name => 'Sale', :foreign_key => 'product_id', :conditions => ["sales.start_date <= ? AND (sales.end_date IS NULL OR sales.end_date > ?)", Time.zone.now, Time.zone.now], :order => "sales.start_date desc" | |
end |
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
def top_menu_cache_key | |
rounded_time = Time.zone.now.round(30.minutes) | |
if Rails.cache.fetch('top_menu_cache_key').nil? || rounded_time != Rails.cache.fetch("rounded_time") | |
debugger | |
Rails.cache.write('top_menu_cache_key', "top_menu:#{Product.active.on_sale.maximum(:updated_at)}") | |
Rails.cache.write('rounded_time', rounded_time) | |
end | |
return Rails.cache.fetch('top_menu_cache_key') | |
end |
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
Desired=Unknown/Install/Remove/Purge/Hold | |
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend | |
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) | |
||/ Name Version Description | |
+++-====================================-====================================-======================================================================================== | |
ii acpi 1.5-2 displays information on ACPI devices | |
ii adduser 3.112+nmu2 add and remove users and groups | |
ii apache2 2.2.16-6+squeeze11 Apache HTTP Server metapackage | |
ii apache2-mpm-prefork 2.2.16-6+squeeze11 Apache HTTP Server - traditional non-threaded model | |
ii apache2-utils 2.2.16-6+squeeze11 utility programs for webservers |
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
$result = [serial] => stdClass Object | |
( | |
[AABBCCDD] => stdClass Object | |
( | |
[serial] => DEIGHNGAMDLLHHMALDBLLGBCDFMOHKLOOHEJBNBOJDELCLHGPGJIEBGJPGBHLFNCNMNOLAENOFGLEPONFPAMMGHJHNNEAHCGEHDHJCDCEPIJDKMELHBMFBLLPPBHKBMADHOBGNHMPOOJFGCHKPNEBBIBMFKJHKCBMPEGOECLKLPKBGJCBMIPNDHOOJLPLMLLLAKIKMIJNHJENLILILOLJMKICNALEIKPIAJCALJEGKHIKKDNLNPEDNOCOOGBDAFABNAAIOMB | |
[hardware_key_id] => AABBCCDD | |
[created] => 1396536543 | |
), | |
[EEEEEE] => stdClass Object | |
( |
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
StockTransaction.joins("LEFT JOIN line_items ON line_items.id = stock_transactions.source_id and source_type = 'LineItem'") | |
.joins(:product) | |
.where("stock_transactions.cause = 'SALE'") |
NewerOlder