Skip to content

Instantly share code, notes, and snippets.

erroring here restangular TypeError: Cannot read property 'isUndefined' of undefined
at Object.Configurer.init (restangular.js:44)
at new <anonymous> (restangular.js:814)
at Object.instantiate (angular.js:4778)
at provider (angular.js:4590)
at Object.provider (angular.js:4582)
at runInvokeQueue (angular.js:4654)
at angular.js:4662
at forEach (angular.js:325)
at loadModules (angular.js:4644)
@anilcancakir
anilcancakir / calculate_url_key_by_id.sql
Last active July 19, 2020 04:17
The Base62 Trigger Function (PostgreSQL)
CREATE OR REPLACE FUNCTION calculate_url_key_by_id() RETURNS trigger
LANGUAGE plpgsql AS
$$
DECLARE
CHARS VARCHAR(62) := '0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ';
BASE INTEGER := 62;
tempId INTEGER;
result VARCHAR(31);
r DOUBLE PRECISION;
q DOUBLE PRECISION;
sql> INSERT INTO urls(key, url) VALUES ('my-key', 'testttt')
[2017-05-31 23:00:54] 1 row affected in 8ms
sql> INSERT INTO urls(url) VALUES ('testttt')
[2017-05-31 23:00:54] [00000] (start) r -> 53
[2017-05-31 23:00:54] [00000] (start) q -> 1
[2017-05-31 23:00:54] [00000] (start) tempFrom -> 54
[2017-05-31 23:00:54] [00000] (start) result -> V
[2017-05-31 23:00:54] [00000] (loop) tempQ -> 1
[2017-05-31 23:00:54] [00000] (loop) r -> 1
[2017-05-31 23:00:54] [00000] (loop) q -> 0
@anilcancakir
anilcancakir / Debian Web Service Install (Ubuntu)
Created October 13, 2017 13:42
Install PHP 7.0 with FPM, Nginx stable, PostgreSQL 10
#!/bin/bash
# Swith to root
sudo su;
echo "Swithed root.";
echo "Show your system information";
lsb_release -a;
# Add the nginx source
@anilcancakir
anilcancakir / main.dart
Created February 28, 2018 21:14
Forms in Flutter - Code #1
import 'package:flutter/material.dart';
void main() => runApp(new MaterialApp(
title: 'Forms in Flutter',
home: new LoginPage(),
));
class LoginPage extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _LoginPageState();
@anilcancakir
anilcancakir / _LoginPageState.dart
Created February 28, 2018 21:22
Forms in Flutter - Code #2
class _LoginPageState extends State<LoginPage> {
final GlobalKey<FormState> _formKey = new GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('Login'),
),
body: new Container(
@anilcancakir
anilcancakir / main.dart
Created February 28, 2018 21:30
Forms in Flutter - Code #3
import 'package:flutter/material.dart';
void main() => runApp(new MaterialApp(
title: 'Forms in Flutter',
home: new LoginPage(),
));
class LoginPage extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _LoginPageState();
@anilcancakir
anilcancakir / main.dart
Created February 28, 2018 21:43
Forms in Flutter - Code #4
import 'package:validate/validate.dart'; // Add import for validate package.
class _LoginPageState extends State<LoginPage> {
// Add validate email function.
String _validateEmail(String value) {
if (!Validate.isEmail(value)) {
return 'The E-mail Address must be a valid email address.';
}
return null;
@anilcancakir
anilcancakir / main.dart
Created February 28, 2018 21:56
Forms in Flutter - Code Final
import 'package:flutter/material.dart';
import 'package:validate/validate.dart';
void main() => runApp(new MaterialApp(
title: 'Forms in Flutter',
home: new LoginPage(),
));
class LoginPage extends StatefulWidget {
@override
@anilcancakir
anilcancakir / new_flutter_project.sh
Created March 1, 2018 11:14
Create a new Flutter project command.
flutter create app