Skip to content

Instantly share code, notes, and snippets.

@sheki
sheki / mockable.js
Created March 31, 2016 01:18
mockable.js
import _ from 'lodash';
const mockMap = new Map();
export function mock(name, obj) {
if (process.env.BRIGHT_ENV === 'prod') {
return obj;
}
if (!_.isObject(obj)) {
@sheki
sheki / test.vim
Created March 17, 2016 16:31
Per project ctrlp cache
function GetDir()
return split(getcwd(), "/")[-1]
endfunction
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp-'.GetDir()
@sheki
sheki / index.html
Created March 15, 2016 22:25
fb send button no worky
<html>
<head>
<title>Your Website Title</title>
<!-- You can use open graph tags to customize link previews.
Learn more: https://developers.facebook.com/docs/sharing/webmasters -->
<meta property="og:url" content="http://www.your-domain.com/your-page.html" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Your Website Title" />
<meta property="og:description" content="Your description" />
<meta property="og:image" content="http://www.your-domain.com/path/image.jpg" />
import React, { Component, PropTypes } from 'react';
import * as Colors from 'material-ui/lib/styles/colors';
import CheckCircle from 'material-ui/lib/svg-icons/action/check-circle';
import Info from 'material-ui/lib/svg-icons/action/info';
import JourneyService from '../../../services/JourneyService';
const aligner = {
display: 'flex',
alignItems: 'flex-start',
sudo: required
language: node_js
env:
- BRIGHT_ENV=travis
before_install:
- rm -f node_modules
@sheki
sheki / travis.yml
Created February 5, 2016 23:33
pbcopy
sudo: false
language: node_js
env:
- BRIGHT_ENV=travis
before_install:
- rm -f node_modules
@sheki
sheki / ci.sh
Created January 22, 2016 00:34
!/bin/bash -e
if [ ! "$CI" == true ]; then
echo "Not running in CI"
exit 1
fi
docker build --tag brightsolar/web-nginx:codeship_build_"$CI_BUILD_NUMBER" nginx/ && docker push brightsolar/web-nginx
docker build --tag brightsolar/web:codeship_build_"$CI_BUILD_NUMBER" --file Dockerfile.prod . && docker push brightsolar/web
@sheki
sheki / boo.cc
Created November 21, 2015 04:05
boom boom
#include <iostream>
#include <cstring>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <cctype>
#include <queue>
#include <map>
#include <fstream>
@sheki
sheki / goodcode.cpp
Created November 21, 2015 03:59
goodcode
#include <iostream>
#include <cstring>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <cctype>
#include <queue>
#include <map>
#include <fstream>
package boom_test
import (
"testing"
)
func BenchmarkHello(b *testing.B) {
for i := 0; i < b.N; i++ {
fibReadable(100000)
}