Skip to content

Instantly share code, notes, and snippets.

View kevinguebert's full-sized avatar
☀️
wattch.io

Kevin Guebert kevinguebert

☀️
wattch.io
  • Roswell, GA
  • 14:49 (UTC -04:00)
View GitHub Profile
@pix-art
pix-art / TimeoutContext.php
Created July 28, 2017 07:04
A timeout context to help you when you have to wait for elements on your page
<?php
namespace FrontendBundle\Features\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Mink\Exception\ElementNotFoundException;
use Behat\Mink\Exception\ElementTextException;
use Behat\Mink\Exception\ResponseTextException;
use Behat\MinkExtension\Context\RawMinkContext;
class TimeoutContext extends RawMinkContext
@RoshanNindrai
RoshanNindrai / parallel.swift
Last active August 5, 2019 15:34
Parallel Map, Filter Implementation
import Foundation
public extension Array {
func pmap<T>(transformer: @escaping (Element) -> T) -> [T] {
var result: [Int: [T]] = [:]
guard !self.isEmpty else {
return []
}
@jesstelford
jesstelford / LEARNING_JS.md
Last active August 2, 2019 23:58
Learning JS links and suggestions

Learn by doing

If you're brand new to the language (welcome!) start here: http://jsforcats.com/ (Silly name, but excellent content)

If you've already got a little bit of coding under your belt, the ⁠⁠absolute best⁠⁠ place / way to learn is with https://nodeschool.io workshops (Full disclosure; I've written 2 of them)

They're all free open source at your own pace workshops where you are given a bit of info, a task, and you must code it up before you can move on (it runs unit tests over your code to verify you completed it)

@crittermike
crittermike / gist:618e57a41286e555dea8
Last active November 24, 2020 21:30
A list of Whens, Thens, and Givens for Drupal Behat testing
Given /^(?:|I )am on "(?P<page>[^"]+)"$/
Given /^(?:|I )am on (?:|the )homepage$/
Given :type content:
Given :vocabulary terms:
Given I am an anonymous user
Given I am at :path
Given I am logged in as :name
Given I am logged in as a user with the :permissions permission(s)
Given I am logged in as a user with the :role role(s)
Given I am logged in as a user with the :role role(s) and I have the following fields:
@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@rtt
rtt / tinder-api-documentation.md
Last active April 20, 2024 17:01
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

@evenchange4
evenchange4 / step.md
Created September 23, 2012 21:55
Deploy a Express.js project on Heroku

Deploy a Express.js project on Heroku

Step by step from command line by Michael Hsu

Quick start

Create a Node.js web framework 'express'

$ express myfirstexpress && cd myfirstexpress

Declare dependencies with NPM /package.json

/*!
* JavaScript function to calculate the destination point given start point latitude / longitude (numeric degrees), bearing (numeric degrees) and distance (in m).
*
* Original scripts by Chris Veness
* Taken from http://movable-type.co.uk/scripts/latlong-vincenty-direct.html and optimized / cleaned up by Mathias Bynens <http://mathiasbynens.be/>
* Based on the Vincenty direct formula by T. Vincenty, “Direct and Inverse Solutions of Geodesics on the Ellipsoid with application of nested equations”, Survey Review, vol XXII no 176, 1975 <http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf>
*/
function toRad(n) {
return n * Math.PI / 180;
};
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.