Skip to content

Instantly share code, notes, and snippets.

View KariHe's full-sized avatar

Kari Heikkinen KariHe

View GitHub Profile
@KariHe
KariHe / app-module.js
Last active November 7, 2019 12:09
GraphQL modules blog post examples
import { FeatureOneModule } from './featureOne';
import { FeatureTwoModule } from './featureTwo';
export const AppModule = new GraphQLModule({
imports: [ FeatureOneModule, FeatureTwoModule ]
});
const server = new ApolloServer({
schema: AppModule.schema,
context: AppModule.context

Keybase proof

I hereby claim:

  • I am karihe on github.
  • I am karihe (https://keybase.io/karihe) on keybase.
  • I have a public key ASD4XoAfIkAvCtE57vx5kMEZpp_NE1lYZF3n_VkZX68YXAo

To claim this, I am signing this object:

@KariHe
KariHe / example-1.html
Last active October 20, 2015 10:02
Using AngularJS directives with the style guide
<div class="sg-input" ng-class="{'sg-input--selected': hasFocus, 'sg-input--invalid': !value && changed, 'sg-input--valid': !!value}">
<label class="sg-input__label">Name</label>
<input class="sg-input__element" name="name" ng-model="value" ng-focus="hasFocus=true" ng-blur="hasFocus=false" ng-change="changed=true" required>
<div class="sg-input__description">User name</div>
</div>
@KariHe
KariHe / http-loader.js
Last active December 15, 2016 13:48
Using AngularJS resource object for loader
angular.module('myApp').factory('httpLoaderInterceptor', ['$rootScope', function($rootScope) {
// Active request count
var requestCount = 0;
function startRequest(config) {
// If no request ongoing, then broadcast start event
if( !requestCount ) {
$rootScope.$broadcast('httpLoaderStart');
}