Skip to content

Instantly share code, notes, and snippets.

View fearphage's full-sized avatar
⌨️
Cache rules everything around me.

Phred Lane fearphage

⌨️
Cache rules everything around me.
View GitHub Profile
@lennybacon
lennybacon / userstyle_jsonview.css
Last active March 2, 2021 16:09
Dark Theme for Firefox/Chrome add-ons JSON View (http://jsonview.com/) and JSON Formatter (https://github.com/callumlocke/json-formatter) by using the add-on Stylish (https://userstyles.org/)
/* ==UserStyle==
@name JSONView Dark
@namespace https://gist.github.com/lennybacon
@version 1.0.1
@description Dark theme for JsonView Extension
@author lennybacon
@homepageURL https://gist.github.com/lennybacon/cb700cee27601e7473dd
@updateURL https://gist.githubusercontent.com/lennybacon/cb700cee27601e7473dd/raw/7cfb8b250a8067122a0f138e4f00ab463b9d59d4/userstyle_jsonview.css
@license CC-BY-SA-4.0
==/UserStyle== */
@ipmb
ipmb / ratelimit.nginxconf
Last active July 21, 2024 05:37
Nginx reverse proxy with rate limiting
upstream myapp {
server 127.0.0.1:8081;
}
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;
@koistya
koistya / ReactJS-Server-Side-Rendering.md
Last active September 15, 2023 07:32
Server-side Rendering (SSR) for ReactJS / Flux Applications. Setting document.title

Files

The basic structure of a React+Flux application (see other examples)

 - /src/actions/AppActions.js     - Action creators (Flux)
 - /src/components/Application.js - The top-level React component
 - /src/constants/ActionTypes.js  - Action types (Flux)
 - /src/core/Dispatcher.js        - Dispatcher (Flux)
 - /src/stores/AppStore.js        - The main store (Flux)
@pkoppstein
pkoppstein / combine.jq
Created August 6, 2014 22:14
A commutative and associative "addition" for JSON objects (written in jq)
# This gist defines a jq function that may be useful when migrating from a "relational" view of things to an "object" view.
#
# For example, suppose we have two JSON objects as follows, corresponding to a row in a relational table:
#
# { "id": 123, "surname": "S", "son": "Son1", }
# { "id": 123, "son": "Son2"}
#
# In this case, we want to merge the objects with the result:
#
# { "id": 123, "surname": "S", "son": ["Son1", "Son2"]}
@sebmarkbage
sebmarkbage / ElementFactoriesAndJSX.md
Last active May 17, 2022 11:06
New React Element Factories and JSX

New React Element Factories and JSX

In React 0.12, we're making a core change to how React.createClass(...) and JSX works.

If you're using JSX in the typical way for all (and only) React components, then this transition will be seamless. Otherwise there are some minor breaking changes described below.

The Problem

@spoike
spoike / reflux.js
Created June 29, 2014 22:23
A simpler implementation of React.JS's Flux
var EventEmitter = require('events').EventEmitter,
_ = require('lodash');
/**
* Creates an action functor object
*/
exports.createAction = function() {
var action = new EventEmitter(),
eventLabel = "action",
@staltz
staltz / introrx.md
Last active April 19, 2025 05:15
The introduction to Reactive Programming you've been missing
@Integralist
Integralist / fp polling xhr.js
Last active July 10, 2016 20:27
Functional Programming: Polling XHR
define(['module/bootstrap'], function(news) {
var $ = news.$;
function seconds(secs) {
return secs * 1000;
}
function incrementDelay() {
// don't want the delay to become ridiculous so I set a threshold I don't want it to go beyond
if (delay < threshold) {
@TooTallNate
TooTallNate / starwars.js
Created May 9, 2014 17:38
A little script to play the ASCII Star Wars, but with a hidden cursor, since over `telnet(1)` the cursor remains visible which is annoying
#!/usr/bin/env node
/**
* A little script to play the ASCII Star Wars, but with a hidden cursor,
* since over `telnet(1)` the cursor remains visible which is annoying.
*/
process.title = 'starwars'
var net = require('net')
@insin
insin / 1.js
Created May 7, 2014 05:29
This is the sort of stuff JSX saves you from having to manage
this.$el.append(domBuilder([
['div.arrow']
, ['div.popup-header'
, ['button.close', {type: 'button'}, '\u00D7']
, ['h3', 'Add menu item']
]
, ['div.popup-body'
, ['form.form-horizontal'
, ['div.control-group'
, ['label.control-label', {'for': 'menuItemType'}, 'Type']