Skip to content

Instantly share code, notes, and snippets.

import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { BluetoothSerial } from '@ionic-native/bluetooth-serial';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
@NgModule({
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { BluetoothSerial } from '@ionic-native/bluetooth-serial';
import { AlertController } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
<ion-list padding>
<button ion-button block (click)="startScanning()">scan</button>
<ion-list-header>
Paired Devices
</ion-list-header>
<ion-item *ngFor="let device of pairedDevices">
{{device.name}}
</ion-item>
<button ion-button block (click)="disconnect()">Disconnect</button>
<ion-list-header>
@krunal
krunal / import_export_translations.rb
Last active August 29, 2015 14:17
Import/Export translations - Tr8n Translation Engine
Steps to copy translations from Server A to Server B
------------------------------------------------------------------------
1) ssh to Server A
2) Execute -> rake tr8n:export_translations
1) Rake will nullify synced_at column
2) Rake will restart Memcached
3) Rake will prompt you to enter a filename
4) Rake will create a new filename.yml file inside your root directory.
3) scp this filename.yml from 'Server A' to 'Server B'
# requires BSD sed
namespace :whitespace do
desc 'Removes trailing whitespace'
task :cleanup do
sh %{for f in `find . -type f | grep -v .git | grep -v ./vendor | grep -v ./tmp | egrep ".(rb|js|haml|html|css|sass)"`;
do sed -i '' 's/ *$//g' "$f";
done}, {:verbose => false}
puts "Task cleanup done"
end