Skip to content

Instantly share code, notes, and snippets.

@iamjohnlong
iamjohnlong / .json
Created August 31, 2022 15:41
ttd feed
{
"options": [
{
"description": {
"localized_texts": [
{
"language_code": "en",
"text": "Atlanta CityPASS"
},
{
const Widget: NextPage = () => {
const router = useRouter();
const { extensionUid } = router.query;
if (!extensionUid) return null;
return (
<>
<Wrapper uid={extensionUid as string} declaration={declaration}>
<Field />
</Wrapper>
{
"activity": {
"category": "My Company",
"id": 1,
"name": "My Company"
},
"attachment": {
"id": 2,
"name": "laugh.flac",
"url": "https://aws_cloudfront/find/large.numbers",
@iamjohnlong
iamjohnlong / raf-boilerplate.js
Created August 28, 2017 15:20 — forked from bendc/raf-boilerplate.js
rAF tutorial: boilerplate code
"use strict";
// animation utils
// ===============
const trackTime = id => {
const [entry] = performance.getEntriesByName(id);
if (!entry) {
performance.mark(id);
// set babel in entry file
require('babel-core/register')({ presets: ['es2015-node5', 'stage-3']})
require('./app')
// The profile model
var profile = require('./profile').get()
profile.then(function() {
AppRouter()
}, function() {
LoginRouter()
})
function AppRouter() {
// Paste in console.
function getScopes(root) {
var scopes = [];
function traverse(scope) {
scopes.push(scope);
if (scope.$$nextSibling)
traverse(scope.$$nextSibling);
if (scope.$$childHead)
traverse(scope.$$childHead);
module.directive "someDirectiveDispatcher", (Messenger)->
return{
restrict: "E"
template: "<h1>Test</h1>"
controller: ($scope)->
$scope.elementClickEvent = ()->
Messenger.call Messenger.REFRESH_SOMETHING
}

Keybase proof

I hereby claim:

  • I am iamjohnlong on github.
  • I am rangafangs (https://keybase.io/rangafangs) on keybase.
  • I have a public key whose fingerprint is 5E27 DDCA 7D75 C0AE 9F42 0572 683F 4192 3282 C09C

To claim this, I am signing this object:

// articles per page
var limit = 10;
// pagination middleware function sets some
// local view variables that any view can use
function pagination(req, res, next) {
var page = parseInt(req.params.page) || 1,
num = page * limit;
db.articles.count(function(err, total) {
res.local("total", total);