Skip to content

Instantly share code, notes, and snippets.

View tlvenn's full-sized avatar

Christian Meunier tlvenn

View GitHub Profile
@tlvenn
tlvenn / zshrc.zsh
Last active August 29, 2015 14:09 — forked from Veraticus/zshrc.zsh
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
---------------------------------------------------------------------
| The CASC (Content Addressable Storage Container) Filesystem |
| Warlords of Draenor Alpha, Build 6.0.1.18125 |
| Written April 14th, 2014 by Caali |
| Version 1.2 |
---------------------------------------------------------------------
Distribution and reproduction of this specification are allowed without
limitation, as long as it is not altered. Quotation in other works is
freely allowed, as long as the source and author of the quote are stated.
@tlvenn
tlvenn / App.js
Last active September 12, 2015 15:33 — forked from mnelson/App.js
CSS Reset for a React App using Radium
import React from 'react'
import Reset from './styles/Reset'
let styles = React.renderToStaticMarkup(<Reset />);
document.head.insertAdjacentHTML('beforeEnd', styles);
// start the app
import Router from './components/Router'
@tlvenn
tlvenn / gitlab.md
Created December 10, 2015 17:53 — forked from fire/gitlab.md
Git lab install on smartos

Gitlabs on Smartos

Note this script is not executable. Please read through and manually apply each command.

Install necessary packages

  pkgin up
  pkgin -y in \
        bash \
        coreutils \
        curl \

gcc47 \

@tlvenn
tlvenn / BridgeManager.h
Created January 4, 2016 11:00 — forked from nickhudkins/BridgeManager.h
RN Relay "Reset" LOLROFLCOPTER.
//
// BridgeManager.h
//
// Created by Nick Hudkins on 12/13/15.
//
#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
@interface BridgeManager : NSObject <RCTBridgeModule>
import {Environment} from 'react-relay';
import invariant from 'invariant';
class RelayStore {
constructor() {
this._env = new Environment();
this._networkLayer = null;
this._taskScheduler = null;
}
@tlvenn
tlvenn / gist:0f9dab8bf6ded9170af8b4cb2f7c11fe
Created April 27, 2016 14:49 — forked from jperkin/gist:3436515
Upgrade SmartOS pkgsrc
From 2012Q1 to 2012Q2, assuming 32-bit dataset (i386)
# Update repositories.conf for pkgin, and set $PKG_PATH for pkg_add
REPO=http://pkgsrc.joyent.com/sdc6/2012Q2/i386/All
echo ${REPO} >/opt/local/etc/pkgin/repositories.conf
export PKG_PATH=${REPO}
# Update core packages manually
pkg_add -u bootstrap-mk-files bmake
@tlvenn
tlvenn / gist:bce2f06f8bdc7e6c1d6521c7e6cfa138
Created May 3, 2016 15:15 — forked from mattconnolly/gist:7804176
Upgrading pkgin repository for a SmartOS zone.

Upgrading SmartOS zone

Make a snapshot first! Upgrading from 2013Q1 to 2013Q3 because I needed newer nginx.

Update pkgin repository

edit the files at:

/opt/local/etc/pkg_install.conf

/opt/local/etc/pkgin/repositories.conf

@tlvenn
tlvenn / get_random_bytes.js
Created May 5, 2016 06:32 — forked from alexdiliberto/get_random_bytes.js
Get random bytes in Javascript (Browser/Node)
let getRandomBytes = (
(typeof self !== 'undefined' && (self.crypto || self.msCrypto))
? function() { // Browsers
var crypto = (self.crypto || self.msCrypto), QUOTA = 65536;
return function(n) {
var a = new Uint8Array(n);
for (var i = 0; i < n; i += QUOTA) {
crypto.getRandomValues(a.subarray(i, i + Math.min(n - i, QUOTA)));
}
return a;
@tlvenn
tlvenn / _readme.md
Created May 24, 2016 13:09 — forked from dboskovic/_readme.md
KeystoneJS: Cloudinary Cache => Amazon S3

I had a client who I built a site for (ecommerce) that had a lot of high resolution images. (running about 500gb/mo). Cloudinary charges $500/mo for this usage and Amazon charges about $40. I wrote some middleware that I used to wrap my cloudinary urls with in order to enable caching. This is entirely transparent and still enables you to use all the cool cloudinary effect and resizing functions. Hopefully this is useful to someone!

I think using deasync() here is janky but I couldn't think of another way to do it that allowed for quite as easy a fix.