Skip to content

Instantly share code, notes, and snippets.

View aripalo's full-sized avatar

Ari Palo aripalo

View GitHub Profile
@aripalo
aripalo / README.md
Last active February 10, 2016 16:30 — forked from renier/fix_vbox_net.rb
Add exception to ipfw firewall (fixes Vagrant+VirtualBox with Cisco VPN)

Should work for Vagrant managed VirtualBox virtual machines hosted on OS X (up to OS X Maverics which has ipfw-based firewall. OS X Yosemite has another pf-based firewall so not sure about that...)

Usage:

Run with sudo and pass in your VirtualBox managed VM's vboxnet IP address or address range:

sudo ruby add_ipfw_exception.rb 172.16.0.0/12
@aripalo
aripalo / yammer-group-emails.js
Last active August 29, 2015 14:17
Yammer: get email addresses of group members
/*
* Get email addresses of Yammer group members
* -------------------------------------------
*
* This script works only when everyone in your organization
* has an email of type <FIRSTNAME>.<LASTNAME>@<YOUR-ORGANIZATION-DOMAIN>
* AND
* everyone in your Yammer organization uses real names
* (and therefore have username of type <FIRSTNAME><LASTNAME>)
*
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>WhatsApp jQuery esimerkki</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Google Analytics skripti -->
<script>
@aripalo
aripalo / unneeded-directives-in-angular2
Last active August 29, 2015 14:16
Unneeded directives in Angular 2 as seen on http://youtu.be/-dMBcqwvYA0
# For properties as seen on http://youtu.be/-dMBcqwvYA0?t=13m42s
ng-bind ng-bind-html ng-bind-template
ng-class ng-class-even ng-class-odd
ng-style
ng-disabled ng-readonly ng-selected
ng-show ng-hide
ng-src ng-srcset ng-href
ng-value
# For events as seen on http://youtu.be/-dMBcqwvYA0?t=17m52s
@aripalo
aripalo / reference-example.html
Last active August 29, 2015 14:16
Angular 2 reference syntax as seen on http://youtu.be/-dMBcqwvYA0?t=19m2s
<!-- Angular 2 reference syntax as seen on http://youtu.be/-dMBcqwvYA0?t=19m2s -->
<button (click)="input.focus()">foo</button>
<input #input type="text" name="user"/><!-- Note the attribute "#input" -->
@aripalo
aripalo / old-angular2-syntax-example.html
Last active August 29, 2015 14:16
Angular 2.x template syntax as revealed on October 28th 2014 at http://jaxenter.com/angular-2-0-112094.html
<!-- as seen October 28th 2014 on http://jaxenter.com/angular-2-0-112094.html -->
<div>
<input type="text" [value]="newTodoTitle">
<button (click)="addTodo()">+</button>
<tab-container>
<tab-pane title="Good kids">
<div [ng-repeat|todo]="todosOf('good')">
<input type="checkbox" [checked]="todo.done">
{{todo.title}}
<button (click)="deleteTodo(todo)">X</button>
@aripalo
aripalo / README.md
Last active August 29, 2015 14:05
Remap Mac OS X Caps Lock key as ⌘ + ←

Remap OS X Caps Lock key as ⌘ + ←

Changes Caps Lock key behaviour to move cursor to beginning of current text line, e.g. the same as +

Follows the tutorial from: http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/

  1. Download & install Seil - formerly known as PCKeyboardHack
  2. Download & install Karabiner - formerly known as KeyRemap4MacBook
  3. In Seil set Change Caps Lock to keycode 80 (F19)
@aripalo
aripalo / convert.rb
Created August 13, 2014 14:04
Converting HTML with UTF-8 encoding to ISO-8859-1
File.open("output.html", 'w') { |file| file.write(File.read(ARGV[0]).encode(Encoding::ISO_8859_1)) }
Mon Aug 19 16:24:38 +0300 2013 Puppet (err): Unable to set ownership of log file
Mon Aug 19 16:24:43 +0300 2013 /Stage[main]/Boxen::Config/File[/opt/boxen]/owner (notice): owner changed '400706' to '400706'
Mon Aug 19 16:24:43 +0300 2013 /Stage[main]/Boxen::Config/File[/opt/boxen/bin]/ensure (notice): created
Mon Aug 19 16:24:43 +0300 2013 /Stage[main]/Boxen::Config/File[/opt/boxen/config]/owner (notice): owner changed '400706' to '400706'
Mon Aug 19 16:24:43 +0300 2013 /Stage[main]/Boxen::Config/File[/opt/boxen/data]/ensure (notice): created
Mon Aug 19 16:24:43 +0300 2013 /Stage[main]/Boxen::Config/File[/opt/boxen/data/project-sockets]/ensure (notice): created
Mon Aug 19 16:24:43 +0300 2013 /Stage[main]/Boxen::Config/File[/opt/boxen/data/puppet]/ensure (notice): created
Mon Aug 19 16:24:43 +0300 2013 /Stage[main]/Boxen::Config/File[/opt/boxen/log]/ensure (notice): created
Mon Aug 19 16:24:43 +0300 2013 /Stage[main]/Boxen::Config/File[/opt/boxen/env.d]/ensure (notice): created
Mon Aug 19 16:24:43 +0300 2013 /
@aripalo
aripalo / bended-shadow.css
Created May 18, 2012 10:42 — forked from nrrrdcore/bending-shadow.css
Simple Bended-Shadow CSS: Create the Bended Photo Effect without writing a million divs.
.bended-shadow {
position: relative;
width: 500px;
margin: 200px auto;
}
.bended-shadow::before, .bended-shadow::after {
content: '';
position: absolute;
width: 60%;