Skip to content

Instantly share code, notes, and snippets.

View Edorka's full-sized avatar
🏠
Working from home

Eduardo Orive Vinuesa Edorka

🏠
Working from home
  • bequant
  • Madrid
View GitHub Profile
@sorenlouv
sorenlouv / determine-changed-props.js
Last active April 18, 2024 16:21
Determine which props causes React components to re-render
import React, { Component } from 'react';
export default function withPropsChecker(WrappedComponent) {
return class PropsChecker extends Component {
componentWillReceiveProps(nextProps) {
Object.keys(nextProps)
.filter(key => {
return nextProps[key] !== this.props[key];
})
.map(key => {
@luciddreamz
luciddreamz / keycloak.sh
Last active February 27, 2024 05:26 — forked from paoloantinori/keycloak.sh
Keycloak Admin API Rest Example: Get User
#!/bin/bash
# requires https://stedolan.github.io/jq/download/
# config
KEYCLOAK_URL=http://localhost:8080/auth
KEYCLOAK_REALM=realm
KEYCLOAK_CLIENT_ID=clientId
KEYCLOAK_CLIENT_SECRET=clientSecret
USER_ID=userId
@obskyr
obskyr / stream_response.py
Last active April 2, 2024 09:53
How to stream a requests response as a file-like object.
# -*- coding: utf-8 -*-
import requests
from io import BytesIO, SEEK_SET, SEEK_END
class ResponseStream(object):
def __init__(self, request_iterator):
self._bytes = BytesIO()
self._iterator = request_iterator
@yesvods
yesvods / gist:51af798dd1e7058625f4
Created August 15, 2015 11:13
Merge Arrays in one with ES6 Array spread
const arr1 = [1,2,3]
const arr2 = [4,5,6]
const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6]
@eristoddle
eristoddle / dh_dyn_dns.py
Created August 10, 2012 20:22
Dynamic DNS Script for the Dreamhost API
#!/usr/bin/python
#Adapted from http://wiki.dreamhost.com/User:Datagrok/ddns
from dreamhostapi import DreamHostServerProxy
from os import environ
import urllib2
def main():
#Your Dreamhost API key
dh_api_key = ''
@swinton
swinton / upstart_virtualenv_test.conf
Created March 5, 2012 15:44
Example of an upstart job running a python script under a virtualenv
########################################
##### upstart_virtualenv_test.conf #####
##### install in /etc/init #####
########################################
description "Testing virtualenv and upstart setup"
env PYTHON_HOME=/home/steve/.virtualenvs/upstart-test
start on runlevel [2345]