Skip to content

Instantly share code, notes, and snippets.

View mynameistechno's full-sized avatar

Mark Matyas mynameistechno

View GitHub Profile
@zulhfreelancer
zulhfreelancer / change-openssl-version.md
Last active February 26, 2024 19:46
How to switch OpenSSL version on Mac using Homebrew?

How to switch OpenSSL version on Mac using Homebrew?

Scenario: you have both OpenSSL 1.0 and 1.1 installed (using Brew) in your OSX system and you want to switch the current active version without removing other versions that already installed. Here is how to do it.

Step 1 - List all OpenSSL versions

$ ls -al /usr/local/Cellar/openssl*

/usr/local/Cellar/openssl:
@alfonsomunozpomer
alfonsomunozpomer / Fetch.test.js
Created September 28, 2017 12:51
How to test a React component that sets its state in componentDidMount with fetch, and how to mock it, in Jest
// https://github.com/alfonsomunozpomer/react-fetch-mock
import React from 'react'
import fetchMock from 'fetch-mock'
import Enzyme from 'enzyme'
import {shallow, mount, render} from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
Enzyme.configure({ adapter: new Adapter() })
@evansde77
evansde77 / mock_requests.py
Last active May 30, 2024 10:11
Example of mocking requests calls
#!/usr/bin/env python
"""
mocking requests calls
"""
import mock
import unittest
import requests
from requests.exceptions import HTTPError
@alexmingoia
alexmingoia / gist:4db967e5aeb31d84847c
Last active August 3, 2018 22:48
Beyond Angular and Backbone with Undirectional apps

Beyond Angular and Backbone with Unidirectional apps

What is a unidirectional app?

Unidirectional is a term coined by React engineers to describe the data flow of an application. Unidirectional apps employ functional reactive programming techniques such as immutability, purity, and most importantly unidirectional (as opposed to bidirectional) data flow.

A unidirectional app is defined by no mutable references no two-way references between concerns.

Unidirectional app flowchart

@acdha
acdha / solr_grouping_backend.py
Last active December 14, 2017 13:45
Experimental django-haystack 2 backend which adds support for Solr's grouping / field collapsing
# encoding: utf-8
"""Experimental Solr Grouping / Field Collapsing backend for Haystack 2.0"""
# NOTE: You must be running the latest Pysolr master - no PyPI release yet!
# See https://gist.github.com/3750774 for the current version of this code
# See http://wiki.apache.org/solr/FieldCollapsing for the Solr feature documentation
from __future__ import absolute_import
import logging
from django.db.models.loading import get_model
@matthewmccullough
matthewmccullough / git-compressing-and-deltas.md
Created May 14, 2012 19:05
Git, Compression, and Deltas - An explanation

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@Aeon
Aeon / 960gs.less
Created March 1, 2010 07:41 — forked from Artanis/960gs.less
LessCSS and 960gs don't play well together normally. Here's the definitions for 960gs to let LessCSS work with it. Looks like we can pull all grid data out of the HTML.
/**
* A LessCSS version of the 960 Grid System
*
* http://lesscss.org/
* http://960.gs/
*/
/*********************************************************************
* Settings *
*********************************************************************/