Skip to content

Instantly share code, notes, and snippets.

View chirgwin's full-sized avatar
🛠️
Making it work now, improving it later.

Geoff Chirgwin chirgwin

🛠️
Making it work now, improving it later.
  • San Francisco Bay Area
  • 12:34 (UTC -12:00)
View GitHub Profile
@funwithflutter
funwithflutter / firebase_authentication_service.dart
Created May 14, 2020 08:47
An example Firebase authentication service class
import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';
import '../models/user.dart';
class FirebaseAuthService {
final FirebaseAuth _firebaseAuth;
final GoogleSignIn _googleSignIn;
FirebaseAuthService({FirebaseAuth firebaseAuth, GoogleSignIn googleSignin})
@praharshbhatt
praharshbhatt / full auth.dart
Last active June 22, 2021 04:48
Full Firebase Authentication for Flutter Mobile and web
import 'package:cloud_firestore/cloud_firestore.dart' as MobFirebaseFirestore;
import 'package:firebase/firebase.dart' as WebFirebase;
import 'package:firebase/firestore.dart' as WebFirestore;
import 'package:firebase_auth/firebase_auth.dart' as MobFirebaseAuth;
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/foundation.dart';
import 'package:google_sign_in/google_sign_in.dart';
import '../main.dart';
@funwithflutter
funwithflutter / user_repository.dart
Last active June 22, 2021 04:50
Flutter Web Firebase Auth
import 'package:firebase/firebase.dart';
import 'package:meta/meta.dart';
@immutable
class UserRepository {
UserRepository({Auth firebaseAuth, GoogleAuthProvider googleSignin})
: _firebaseAuth = firebaseAuth ?? auth(),
_googleSignIn = googleSignin ?? GoogleAuthProvider();
final Auth _firebaseAuth;
@shacker
shacker / gist:87908e13c9ee6655ce90
Last active July 17, 2024 14:55
Using the Workday API with Python and the suds client library
import sys
from suds import client
from suds.wsse import Security, UsernameToken
from suds.sax.text import Raw
from suds.sudsobject import asdict
from suds import WebFault
'''
Given a Workday Employee_ID, returns the last name of that employee.
@david-mark
david-mark / gist:3279190
Created August 6, 2012 22:47
Sencha Touch Still Sucks

Was asked to look at this thing again; only reviewed the JS portion. Last I checked, the CSS was similarly reality-challenged. Graphics are nice, but are tantamount to the paint job on a used car. Under the hood, this thing is all junk. It's hard to imagine the innards of any Web or mobile device-based application would end up like this, which raises the question of whether the authors have ever written such applications (or any amount of meaningful JS).

/**
 * @class Ext
 * @singleton

There (still) are no "classes" or "singletons" in JS (starting off on the wrong foot by mangling JS terms).

@sosedoff
sosedoff / opentable_client.rb
Last active September 15, 2020 14:46
OpenTable API Client - Visit http://opentable.herokuapp.com for details
require "faraday"
require "faraday_middleware"
module OpenTable
class Error < StandardError ; end
module Request
API_BASE = "http://opentable.herokuapp.com"
def connection
@altintx
altintx / swipe_to_delete.js
Created April 20, 2012 19:26
Swipe to Delete on Sencha Touch 2.0 list
/* Assuming:
* dataview is a { xtype: "list" }
* dataview.itemTpl includes a <div class="deleteplaceholder"></div>
*
* Delete button will disappear as soon as something is touched
*/
dataview.on("itemswipe", function(dataview, ix, target, record, event, options) {
if (event.direction == "left") {
var del = Ext.create("Ext.Button", {
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId,
UserSchema = require('./User').UserSchema;
var FriendRequest = new Schema({
from : {type: ObjectId, index:true}, // Why does not UserSchema.ObjectId work here, instead of ObjectId?
to : {type: ObjectId, index:true},