Skip to content

Instantly share code, notes, and snippets.

#include <Windows.h>
#include "../../API/RainmeterAPI.h"
struct ACCENTPOLICY {
int nAccentState;
int nFlags;
int nColor;
int nAnimationId;
};
struct WINCOMPATTRDATA {

This is a proposal for a lightning talk at the Reactive 2016 conference. If you like this, star the Gist.


Thinking metrics on React applications

In regular websites, it is common to send multiple events to track user clicks. Single Page Applications change the way you look at metrics. This is a talk about a simple pattern we created at Globo.com to manage a metrics layer for http://globoplay.globo.com. The talk will cover how to track user flow using Google Analytics and other services. We solved the challenge of tying metrics and components, keeping information across pages and having global data. Also some React, React Router and React Side Effects concepts like context, higher order components, history state will be covered.

@nolanlawson
nolanlawson / windows.md
Last active December 28, 2018 22:24
Git/Bash/Node/npm on Windows

Git/Bash/Node/npm on Windows

Update: there's an easier way to do this. Check out my new gist instead.

How I set up my Windows 10 machine for Node development. Time to complete: about 2 hours on a fast connection.

Requirements

  • Bash, not Windows shell

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

@gaearon
gaearon / slim-redux.js
Last active March 25, 2024 19:12
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
var randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5]
randomNumbers
func 💩Sort(arr: Int[]) -> Int[] {
var array = arr.copy()
// Private function to check whether or not the array is sorted
func isSorted (arr: Int[]) -> Bool {
@cameron
cameron / docker-ssl-cert-generate
Last active February 2, 2023 10:09
Generate self-signed SSL certs for docker client <— HTTPS —> daemon
#! /bin/bash
# HEADS UP! Make sure to use '*' or a valid hostname for the FDQN prompt
echo 01 > ca.srl
openssl genrsa -des3 -out ca-key.pem
openssl req -new -x509 -days 365 -key ca-key.pem -out ca.pem
openssl genrsa -des3 -out server-key.pem
openssl req -new -key server-key.pem -out server.csr
@OdeToCode
OdeToCode / gist:5024867
Last active December 14, 2015 03:59
AngularJS Snippet
<div ng-app="videoApp" ng-controller="VideoController">
<table>
<thead>
<th>Title</th>
<th>Length</th>
<th></th>
</thead>
<tbody>
<tr data-id="{{video.Id}}" ng-repeat="video in videos">
@felipeleusin
felipeleusin / ReturnPArtialIfAjaxAttribute.cs
Created May 23, 2012 13:56
ActionFilter para converter para Ajax a Action
public class ReturnPartialIfAjaxAttribute : ActionFilterAttribute
{
private readonly string partialViewName;
public ReturnPartialIfAjaxAttribute(string partialViewName)
{
this.partialViewName = partialViewName;
}
public override void OnActionExecuted(ActionExecutedContext filterContext)