Skip to content

Instantly share code, notes, and snippets.

View vinhhungle's full-sized avatar

Hung Le vinhhungle

View GitHub Profile
@vinhhungle
vinhhungle / create_topic.md
Last active November 25, 2018 10:46
Salesforce Streaming API Test

Open Dev Console > Debug > Open Execute Anonymous Window

Execute the codes below:

PushTopic pushTopic = new PushTopic();
pushTopic.ApiVersion = 37.0;
pushTopic.Name = 'AllAccounts';
pushTopic.Description = 'All records for the Account object';
pushtopic.Query = 'SELECT Id, Name FROM Account';

Angular2 + JSPM cheat sheet

First time setup

  • install jspm beta: npm install -g jspm@beta
  • set up your project: jspm init
  • install dependencies: jspm install angular2 reflect-metadata zone.js es6-shim

This will create a jspm_packages folder, and a config.js file.

Open the config.js file - this file manages options for the System.js loader - tweak it as appropriate

@sararob
sararob / data-structure.js
Last active April 26, 2022 22:21
Role-based security in Firebase
/*
This example shows how you can use your data structure as a basis for
your Firebase security rules to implement role-based security. We store
each user by their Twitter uid, and use the following simplistic approach
for user roles:
0 - GUEST
10 - USER
20 - MODERATOR
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@alexindigo
alexindigo / gist:1871785
Created February 20, 2012 22:03
set browser specific classes using jQuery
// {{{ win-safari hacks, scratch this,
// let's just expose platform/browser to css
(function()
{
var uaMatch = '', prefix = '';
if (navigator.userAgent.match(/Windows/))
{
$('html').addClass('x-win');
}
@cowboy
cowboy / HEY-YOU.md
Last active May 16, 2024 13:31
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.