Skip to content

Instantly share code, notes, and snippets.

Avatar
🥔

Dmitry Manannikov slonoed

🥔
View GitHub Profile
View bootstrap-em.less
/**
* Use em or rem font-size in Bootstrap 3
*/
@font-size-root: 14px;
@font-unit: 0rem; // Pick em or rem here
// Convert all variables to em
View bootstrap-em.less
/**
* Use em or rem font-size in Bootstrap 3
*/
@font-size-root: 14px;
@font-unit: 0rem; // Pick em or rem here
// Convert all variables to em
View commit-emoji.md
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • when adding feature
  • when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug
@slonoed
slonoed / jump_out_of_chrome_sandbox.js
Created Nov 3, 2012 — forked from tavisrudd/jump_out_of_chrome_sandbox.js
notes on how to break out of chrome extension content script sandboxes and eval code in page context
View jump_out_of_chrome_sandbox.js
// Chrome extension 'content scripts' run in a sandboxed 'isolated world'
// (http://code.google.com/chrome/extensions/content_scripts.html#execution-environment).
// However, there are ways to get out and execute js code in the page
// context. Google searching revealed the following ways:
////////////////////////////////////////////////////////////////////////////////
// http://blog.afterthedeadline.com/2010/05/14/how-to-jump-through-hoops-and-make-a-chrome-extension/
// it looks like jQuery must be loaded by the content-script
jQuery('body').append('<script type="text/javascript">(function(l) {
var res = document.createElement('SCRIPT');
View gist:43a12bf5e56940edc1fc
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
View micro-mustache.js
// Simple JavaScript Templating
// John Resig - http://ejohn.org/ - MIT Licensed
(function(){
var cache = {};
this.tmpl = function tmpl(str, data){
// Figure out if we're getting a template, or if we need to
// load the template - and be sure to cache the result.
var fn = !/\W/.test(str) ?
cache[str] = cache[str] ||
@slonoed
slonoed / lambda-dynamo
Created Feb 26, 2016 — forked from markusklems/lambda-dynamo
Short aws lambda sample program that puts an item into dynamodb
View lambda-dynamo
// create an IAM Lambda role with access to dynamodb
// Launch Lambda in the same region as your dynamodb region
// (here: us-east-1)
// dynamodb table with hash key = user and range key = datetime
console.log('Loading event');
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
exports.handler = function(event, context) {
View parsei18n
'use strict';
const _ = require('lodash');
const path = require('path');
const estraverse = require('estraverse');
const esprima = require('esprima');
const recursive = require('recursive-readdir');
const babel = require('babel-core')
const fs = require('fs');
View sentry compose
redis:
image: redis
postgres:
image: postgres
environment:
- POSTGRES_PASSWORD=sentry
- POSTGRES_USER=sentry
volumes:
- /var/lib/postgresql/data
View iterm2 vim tmux navigation
https://github.com/neovim/neovim/issues/2048
Add Ctrl+h as Keyboard Shortcut
Choose Send Escape Sequence as Action
Type [104;5u for Esc+