This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "gsap-to-video", | |
| "version": "1.0.0", | |
| "main": "index.js", | |
| "license": "MIT", | |
| "dependencies": { | |
| "fs-extra": "^7.0.0", | |
| "puppeteer": "^1.7.0" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var request = require('request'); | |
| var unzip = require('unzip'); | |
| var csv2 = require('csv2'); | |
| request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip') | |
| .pipe(unzip.Parse()) | |
| .on('entry', function (entry) { | |
| entry.pipe(csv2()).on('data', console.log); | |
| }) | |
| ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This does not include WebPageTest submission, only an illustration | |
| # how to use the Logging API from the WebDriver Python bindings. | |
| from selenium import webdriver | |
| from selenium.webdriver.common import keys | |
| driver = webdriver.Chrome( | |
| executable_path="chromedriver2_server", | |
| desired_capabilities={'loggingPrefs': {'performance': 'INFO'}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| requires libgit2 | |
| */ | |
| package main | |
| import ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.core import urlresolvers | |
| from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned | |
| from django.db import transaction | |
| from tastypie.exceptions import BadRequest | |
| from tastypie.http import HttpAccepted, HttpGone, HttpMultipleChoices | |
| from tastypie.utils import dict_strip_unicode_keys | |
| class Patchable(object): | |
| """ | |
| Mixin adding PATCH support to a ModelResource. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tastypie import fields | |
| from tastypie.authentication import Authentication | |
| from tastypie.authorization import Authorization | |
| from tastypie.bundle import Bundle | |
| from tastypie.exceptions import NotFound | |
| from tastypie.resources import Resource | |
| # a dummy class representing a row of data | |
| class Row(object): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import bb.cascades 1.0 | |
| Page { | |
| content: Container { | |
| Label { | |
| id: emailLabel | |
| text: qsTr("Email") | |
| } | |
| Label { | |
| id: urlLabel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // example using the raf module from npm. try changing some values! | |
| var requestAnimationFrame = require("raf") | |
| var canvas = document.createElement("canvas") | |
| canvas.width = 500 | |
| canvas.height = 500 | |
| document.body.appendChild(canvas) | |
| var context = canvas.getContext("2d") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Array.prototype.chunk = function (n) { | |
| return this.reduce(function (g,v,i) { | |
| var chunk = (i-i%n) / n; | |
| if (!(i%n)) g[chunk] = []; | |
| g[chunk].push(v); | |
| return g; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isValidURL(s) { | |
| var testRegex = /^https?:\/\/(?:[a-z\-]+\.)+[a-z]{2,6}(?:\/[^\/#?]+)+\.(?:jpe?g|gif|png)$/; | |
| return testRegex.test(s); | |
| } |