Skip to content

Instantly share code, notes, and snippets.

View andruu's full-sized avatar
😎
What is this?

Andrew Weir andruu

😎
What is this?
View GitHub Profile
import { getAmountAndScale } from '../utils';
import { transformScale } from './transformScale';
export function multiply(calculator) {
var convertScaleFn = transformScale(calculator);
var zero = calculator.zero();
return function multiplyFn() {
for (var _len = arguments.length, _ref = new Array(_len), _key = 0; _key < _len; _key++) {
_ref[_key] = arguments[_key];
}
@andruu
andruu / iptv-api.ts
Last active December 24, 2020 22:22
import axios from 'axios';
export interface ApiInput {
url: string;
username: string;
password: string;
type?: string;
output?: string;
}
mutation {
userCreate(name:"Andrew Test",email:"",password:""){
id
name
email
created
}
}
import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
import { CreateUserArgs } from './dtos/create-user.args';
import { User } from './user.entity';
import { UserService } from './user.service';
@Resolver(of => User)
export class UserResolver {
constructor(private userService: UserService) {}
import { IsEmail, MinLength } from 'class-validator';
import { ArgsType, Field } from 'type-graphql';
@ArgsType()
export class CreateUserArgs {
@Field()
name: string;
@Field()
@IsEmail()
def normalized_attributes(attributes)
longitude = attributes.delete(:longitude)
latitude = attributes.delete(:latitude)
attributes[:coordinate] = RGeo::Geographic.spherical_factory(srid: 4326).point(
longitude,
latitude
) if longitude && latitude
attributes
end
this is a test
@andruu
andruu / -
Created January 14, 2015 15:14
Available versions:
1.8.6-p383
1.8.6-p420
1.8.7-p249
1.8.7-p302
1.8.7-p334
1.8.7-p352
1.8.7-p357
1.8.7-p358
1.8.7-p370
Available versions:
1.8.6-p383
1.8.6-p420
1.8.7-p249
1.8.7-p302
1.8.7-p334
1.8.7-p352
1.8.7-p357
1.8.7-p358
1.8.7-p370
app.factory('Auth', function (Firebase, $rootScope, $localStorage) {
var auth = new FirebaseSimpleLogin(Firebase.reference, function (error, user) {
if (error) {
$rootScope.$emit('firebase.error', error);
} else if (user) {
// We have user
$localStorage.current_user = user;
$localStorage.logged_in = true;