Skip to content

Instantly share code, notes, and snippets.

View andris-silis's full-sized avatar

Andris Sīlis andris-silis

View GitHub Profile
Z420 http://technofaq.org/posts/2014/09/installing-mac-osx-10-9-4-mavericks-on-hp-z420-workstation/
Z620 http://sixflow.net/osx86/System/86380
https://support.hp.com/us-en/product/hp-z620-workstation/5225037/document/c03270936#AbT2
### z620 hackintosh, Sierra, 10.12.4
#### Partial hardware info of z620:
- Intel 82579LM Ethernet
- ALC262 audio
@andris-silis
andris-silis / React's report on DOM updates done
Last active August 29, 2015 14:22
ReactJS test of table rendering
0".0.0.0.$0.$0""set textContent""{"textContent":"0.40472540468908846"}"
1".0.0.0.$1.$0""set textContent""{"textContent":"0.4246360862161964"}"
2".0.0.0.$2.$0""set textContent""{"textContent":"0.038479496724903584"}"
3".0.0.0.$3.$0""set textContent""{"textContent":"0.6841884981840849"}"
4".0.0.0.$4.$0""set textContent""{"textContent":"0.6603023638017476"}"
5".0.0.0.$5.$0""set textContent""{"textContent":"0.28145029209554195"}"
6".0.0.0.$6.$0""set textContent""{"textContent":"0.695664837025106"}"
7".0.0.0.$7.$0""set textContent""{"textContent":"0.889470687834546"}"
8".0.0.0.$8.$0""set textContent""{"textContent":"0.251313682179898"}"
9".0.0.0.$9.$0""set textContent""{"textContent":"0.4046918931417167"}"
@andris-silis
andris-silis / 1.md
Last active January 2, 2016 02:39 — forked from 8bitDesigner/1.md
Update git project's bower and npm packages on git pull, merge and checkout

Make bower and npm package install easy

This repo has some handy handy hooks to run bower update or npm install whenever you:

  • git checkout a new branch with a different package.json or bower.json
  • git pull a change to package.json or bower.json
@andris-silis
andris-silis / Flask SSL-only Session Interface
Last active December 20, 2015 05:18
SSL-only session interface for Flask. Sets session cookie only on SSL connection to prevent session hijacking. Sessions will not work on unsecured connections. Need to implement additional secondary session for insecure connection if flashes or something is needed.
# Usage:
app = Flask()
app.session_interface = SecureCookieSSLOnlySessionInterface()
from flask.sessions import SecureCookieSessionInterface
from flask import request
class SecureCookieSSLOnlySessionInterface(SecureCookieSessionInterface):
"""The SSL cookie session interface. Sets cookie only on SSL connections.
@andris-silis
andris-silis / backbone.js-sync-setTimeout
Created April 27, 2012 08:16
extended backbone.js sync function. uses setTimeout to batch multiple saves on one model in one http request.
// decreases request count on rapid-fire one model saves
// extended backbone.js sync function. uses setTimeout to batch multiple saves on one model in one http request.
// if client side needs immediate answer from server for changes in model attributes,
// pass { immediate: true } in model save options if { wait: true } is not used already.
Backbone._sync=Backbone.sync
Backbone.sync = function(method, model, options){
var maxResetCount=5 // how many times to delay save
var saveBufferSize=3000 // for how many microseconds save is delayed
var immediate=options['wait'] || options['immediate'] || false