Skip to content

Instantly share code, notes, and snippets.

View riston's full-sized avatar

Risto Novik riston

View GitHub Profile
@Burgestrand
Burgestrand / expanding-textarea.htm
Created January 16, 2010 14:00
A self-expanding textarea similar to Facebook’s implementation
<!DOCTYPE html>
<html>
<head>
<title>Self-expanding textarea</title>
</head>
<body>
<textarea id="expand" rows="8" cols="40"></textarea>
<script type="text/javascript" charset="utf-8">
var textarea = document.getElementById('expand')
var div = document.createElement('div')
@mathiasbynens
mathiasbynens / change-favicon.js
Created June 7, 2010 12:41
Dynamically changing favicons with JavaScript
/*!
* Dynamically changing favicons with JavaScript
* Works in all A-grade browsers except Safari and Internet Explorer
* Demo: http://mathiasbynens.be/demo/dynamic-favicons
*/
// HTML5™, baby! http://mathiasbynens.be/notes/document-head
document.head || (document.head = document.getElementsByTagName('head')[0]);
function changeFavicon(src) {
@andris9
andris9 / nodejs_idcard.js
Created August 8, 2011 19:51
Node.js + ID kaart
var https = require('https'),
fs = require('fs'),
utillib = require('util');
var options = {
key: fs.readFileSync('private_key.pem'),
cert: fs.readFileSync('certificate.pem'),
ca: [
fs.readFileSync('ESTEID-SK 2007.PEM.cer'),
fs.readFileSync('ESTEID-SK.PEM.cer'),
@mbostock
mbostock / .block
Last active January 26, 2022 14:32 — forked from mbostock/.block
Spline Transition
license: gpl-3.0
@mattratleph
mattratleph / vimdiff.md
Last active April 24, 2024 11:28 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@mweibel
mweibel / passport-mock.js
Last active December 5, 2022 03:33
Mock passport.js with an own strategy
/**
* Author: Michael Weibel <michael.weibel@gmail.com>
* License: MIT
*/
var passport = require('passport')
, StrategyMock = require('./strategy-mock');
module.exports = function(app, options) {
// create your verify function on your own -- should do similar things as
@jonatw
jonatw / install_opencv_debian.sh
Last active September 1, 2016 04:58
install opencv on debian, tested on raspberry pi (debian wheezy)it takes "long time" for compiling opencv library. please be patient.Reference: http://opencv.willowgarage.com/wiki/InstallGuide_Linux
#install esseintal packages for opencv
apt-get -y install build-essential
apt-get -y install cmake
apt-get -y install pkg-config
apt-get -y install libgtk2.0-dev libgtk2.0
apt-get -y install zlib1g-dev
apt-get -y install libpng-dev
apt-get -y install libjpeg-dev
apt-get -y install libtiff-dev
apt-get -y install libjasper-dev
@jkresner
jkresner / test-passport.coffee
Created June 20, 2013 17:50
Passport.js user mocking version 2
users = require './../data/users'
data = users: []
data.users.anon = authenticated: false
data.users.admin = users[0]
data.users.jk = users[1]
data.users.artle = users[5]
data.users.beountain = users[4]
setSession = (userKey) ->
@chuckg
chuckg / SPLUNK_RECIPES.md
Last active May 18, 2020 17:37
Splunk Storm recipes for Heroku logs.

Splunk Recipes for Heroku

A collection of Splunk recipes for Heroku logs. Instructions for setting up Splunk Storm with Heroku can be found here. For the vast majority of these recipes you'll need to have enabled the Heroku labs feature, log-runtime-metrics, for your application.

@jonah-williams
jonah-williams / circle.yml
Last active May 29, 2019 14:53
Automating deployments to Heroku from CircleCI
test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300