In this snippets with code ruby, you will see the sintax of create Structs and some Ruby 2.0+ features. The features are showed:
- **keyargs and labelled params
class MyModel < ActiveRecord::Base | |
attr_acessible :name, :value, :role_id | |
# Another strategy: multiple conditions with | |
# multiple ActiveRecord::Relation#where() method calls | |
def recipients(offset=0, limit=100, data = {}) | |
result = self.order(:id).offset(offset).limit(limit).where('value IS ?', nil) |
source 'https://rubygems.org' | |
gem 'rspec', require: false, group: :test | |
gem 'simplecov', require: false, group: :test |
Author: Michel Felipe
Download and install latest mono runtime. Follow the instructions here: Install mono on Debian, Ubuntu, and derivatives
Clone the latest version from MonoDevelop github repo.
git clone git@github.com:mono/monodevelop.git
describe('npm validation logic (inquirer `when` function)', function () { | |
beforeEach(function () { | |
askName2 = proxyquire('../lib', { | |
'npm-name': function(name){ | |
return Promise.resolve(name == 'yo'); | |
} | |
}); | |
it('ask question if npm name is taken', function (done) { | |
this.inquirer.prompt.returns(Promise.resolve({name:'yo'})); |
import { DebugElement, Type } from "@angular/core"; | |
import { Predicate } from "@angular/core/src/facade/collection"; | |
import { TestBed, ComponentFixture } from '@angular/core/testing'; | |
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; | |
import { App, MenuController, NavController, Platform, Config, Keyboard, GestureController, Form, IonicModule } from 'ionic-angular'; | |
import { mockNavController, mockPlatform } from 'ionic-angular/util/mock-providers'; | |
import { ConfigMock, MenuControllerMock, KeyboardMock, GestureControllerMock, FormMock } from './mocks'; | |
/** | |
* @ngdoc object |
To reference to a local path reference to a wordpress plugin, using Composer, you need do:
Add a repository
pointing to local path (absolute or relative) like the composer.json
Add a installer-paths
key to move to a specific folder when install the plugin, only if the target plugin contains
contains a composer.json
with type
"wordpress-plugin"
public class AndroidWebview extends CordovaWebView { | |
/** | |
* Use webview.sendJavascript is deprecated in latest cordova-android | |
* Insteadof, pass a JS callback like a success function in cordova.exec() | |
* cordova plugin JS Bridge, and execute a callbackContext.sendPluginResult(result); | |
* in Java. | |
* | |
* Use this, only if you wish call JS from Java webview/cordova app in old |
Here you will find examples of modules in ruby code. The structure is strong, very important and commonly used by ruby developers! Modules can be used like namespaces or mixins (adds new methods to a class).
In ruby code it's common see something like this:
MyModule::MyClass
The character :: is a namespace separator. A dot '.' can be used to, but it's not recommended.
// This is a working .gradle file for cordova-plugin-fcm-with-updated plugin, | |
// to use with cordova-android 6.3.0 | |
def FCM_CORE_VERSION = System.getenv("FCM_CORE_VERSION") ?: '16.0.9' | |
def FCM_VERSION = System.getenv("FCM_VERSION") ?: '18.0.0' | |
buildscript { | |
repositories { | |
mavenCentral() | |
jcenter() |