Browse Source

Improvements to site, one new post

master
Kim Grytøyr 1 year ago
parent
commit
93ec0ee9f6
100 changed files with 2060 additions and 1032 deletions
  1. 1
    1
      config.toml
  2. 7
    1
      content/about.md
  3. 2
    0
      content/post/2014-07-08-going-static.md
  4. 5
    5
      content/post/2014-07-09-case-sensitivty-problem-with-git-in-os-x.md
  5. 7
    7
      content/post/2014-09-03-opening-sublime-text-from-the-command-line.md
  6. 10
    10
      content/post/2015-06-14-locationpicker.js.md
  7. 2
    2
      content/post/2015-06-14-using-launchctl-on-mac-osx-10-10.markdown
  8. 6
    6
      content/post/2015-06-21-mutt-tips-and-tricks.md
  9. 14
    14
      content/post/2015-08-09-basic-usage-of-git-svn.md
  10. 5
    4
      content/post/2015-08-09-deleteing-rows-with-a-left-join-in-mysql.markdown
  11. 2
    2
      content/post/2015-08-09-useful-git-tips.md
  12. 12
    12
      content/post/2016-01-21-creating-a-bootable-usb-stick-on-os-x.md
  13. 24
    0
      content/post/2018-02-09-ubuntu-sudo-nopasswd.md
  14. 9
    9
      content/post/ludum-dare-38.md
  15. 1
    1
      invalidate_cahe.sh
  16. 36
    31
      public/2014/07/08/going-static/index.html
  17. 30
    31
      public/2014/07/09/case-sensitivty-problem-with-git-in-os-x/index.html
  18. 33
    35
      public/2014/09/03/opening-sublime-text-from-the-command-line/index.html
  19. 68
    72
      public/2015/06/14/locationpicker.js/index.html
  20. 41
    41
      public/2015/06/14/using-launchctl-on-mac-osx-10-10/index.html
  21. 34
    36
      public/2015/06/21/mutt-tips-and-tricks/index.html
  22. 43
    46
      public/2015/08/09/basic-usage-of-git-svn/index.html
  23. 30
    29
      public/2015/08/09/deleteing-rows-with-a-left-join-in-mysql/index.html
  24. 26
    25
      public/2015/08/09/useful-git-tips/index.html
  25. 36
    39
      public/2016/01/21/creating-a-bootable-usb-stick-on-os-x/index.html
  26. 24
    23
      public/2016/01/21/trouble-booting-newer-linux-kernels-on-asus-vivopc-vm42/index.html
  27. 24
    23
      public/2016/01/31/resizing-windows-on-linux/index.html
  28. 15
    14
      public/404.html
  29. 34
    25
      public/about/index.html
  30. 178
    0
      public/categories/index.html
  31. 1
    0
      public/categories/page/1/index.html
  32. 18
    9
      public/categories/posts-development/index.html
  33. 1
    1
      public/categories/posts-development/page/1/index.html
  34. 18
    9
      public/categories/posts-email/index.html
  35. 1
    1
      public/categories/posts-email/page/1/index.html
  36. 18
    9
      public/categories/posts-linux/index.html
  37. 1
    1
      public/categories/posts-linux/page/1/index.html
  38. 18
    9
      public/categories/posts/index.html
  39. 3
    3
      public/categories/posts/index.xml
  40. 1
    1
      public/categories/posts/page/1/index.html
  41. 18
    9
      public/categories/projects/index.html
  42. 1
    1
      public/categories/projects/page/1/index.html
  43. 31
    65
      public/css/highlight.css
  44. 9
    1
      public/css/style.css
  45. 27
    18
      public/index.html
  46. 17
    5
      public/index.xml
  47. 3
    1
      public/js/highlight.js
  48. 13
    0
      public/js/instantclick.min.js
  49. 3
    0
      public/js/jquery.min.js
  50. 1
    1
      public/page/1/index.html
  51. 27
    10
      public/page/2/index.html
  52. 24
    23
      public/post/2017-07-30-ludum-dare-39/index.html
  53. 274
    0
      public/post/2018-02-09-ubuntu-sudo-nopasswd/index.html
  54. 24
    23
      public/post/3d-model-of-a-book/index.html
  55. 27
    18
      public/post/index.html
  56. 15
    4
      public/post/index.xml
  57. 34
    36
      public/post/ludum-dare-38/index.html
  58. 24
    23
      public/post/new-website-platform/index.html
  59. 1
    1
      public/post/page/1/index.html
  60. 27
    10
      public/post/page/2/index.html
  61. 28
    10
      public/sitemap.xml
  62. 18
    9
      public/tags/3d-book/index.html
  63. 1
    1
      public/tags/3d-book/page/1/index.html
  64. 18
    9
      public/tags/3d/index.html
  65. 1
    1
      public/tags/3d/page/1/index.html
  66. 18
    9
      public/tags/aws/index.html
  67. 1
    1
      public/tags/aws/page/1/index.html
  68. 18
    9
      public/tags/blender/index.html
  69. 1
    1
      public/tags/blender/page/1/index.html
  70. 18
    9
      public/tags/boot/index.html
  71. 1
    1
      public/tags/boot/index.xml
  72. 1
    1
      public/tags/boot/page/1/index.html
  73. 18
    9
      public/tags/case-sensitivity/index.html
  74. 1
    1
      public/tags/case-sensitivity/page/1/index.html
  75. 18
    9
      public/tags/cloudfront/index.html
  76. 1
    1
      public/tags/cloudfront/page/1/index.html
  77. 18
    9
      public/tags/command-lin/index.html
  78. 1
    1
      public/tags/command-lin/page/1/index.html
  79. 18
    9
      public/tags/command-line/index.html
  80. 1
    1
      public/tags/command-line/page/1/index.html
  81. 18
    9
      public/tags/database/index.html
  82. 1
    1
      public/tags/database/page/1/index.html
  83. 18
    9
      public/tags/disk-image/index.html
  84. 1
    1
      public/tags/disk-image/page/1/index.html
  85. 18
    9
      public/tags/email/index.html
  86. 1
    1
      public/tags/email/page/1/index.html
  87. 18
    9
      public/tags/gamedev/index.html
  88. 1
    1
      public/tags/gamedev/page/1/index.html
  89. 18
    9
      public/tags/geodecoding/index.html
  90. 1
    1
      public/tags/geodecoding/page/1/index.html
  91. 18
    9
      public/tags/git-svn/index.html
  92. 1
    1
      public/tags/git-svn/page/1/index.html
  93. 18
    9
      public/tags/git/index.html
  94. 1
    1
      public/tags/git/page/1/index.html
  95. 18
    9
      public/tags/hugo/index.html
  96. 1
    1
      public/tags/hugo/page/1/index.html
  97. 227
    0
      public/tags/index.html
  98. 24
    6
      public/tags/index.xml
  99. 18
    9
      public/tags/javascript/index.html
  100. 0
    0
      public/tags/javascript/page/1/index.html

+ 1
- 1
config.toml View File

@@ -17,7 +17,7 @@ disqusShortname = ""
bio = "Programmer - Tech enthusiast"
# Enter optionally your twitter account
twitter = "kimgrytoyr"
enableRSS = true
enableRSS = false

# Integrate Javascript files or stylesheets by adding the url to the external assets or by
# linking local files with their path relative to the static folder, e.g. "css/styles.css"

+ 7
- 1
content/about.md View File

@@ -4,4 +4,10 @@ description = "About me and this site."
title = "About"
+++

You are now viewing my personal website. Not much to say about it.
You are now viewing my personal website. Here's a list of topics you can expect to find posts about on this site:

- Programming
- Linux
- Technology in general
- Flight simulation (X-plane)
- Game development (Unity, Blender)

+ 2
- 0
content/post/2014-07-08-going-static.md View File

@@ -8,6 +8,8 @@ tags:
- static
---

> **Update 2018-02-09:** The information in this post is no longer current. Please read [this post](/post/new-website-platform/) for information about my current setup.

My personal homepage has been powered by [Wordpress](https://wordpress.org) for several years. There's nothing wrong with Wordpress, it's a mature blogging platform with a plethora of plugins and themes to choose from. Nevertheless, lately I've been wanting to use a static site generator for my personal homepage. Here are some of the reasons why:

* I want to use Markdown

+ 5
- 5
content/post/2014-07-09-case-sensitivty-problem-with-git-in-os-x.md View File

@@ -16,20 +16,20 @@ I've several times experienced problems with files and folders having incorrect

First off, here's a solution published at [Coderwall.com](https://coderwall.com/p/mgi8ja):

{{< highlight bash >}}
```shell
git mv filename filename_tmp
git mv filename_tmp Filename
git commit -m "Set correct case for filename"
{{< / highlight >}}
```

The author mentions that this is a hack and that it could possibly mess up other users' repositories, and that a `git pull` by other users won't include this change.

In a comment to that article, a user suggests the following approach instead:

{{< highlight bash >}}
```shell
git mv --force filename Filename
git commit -m "Set correct case for filename"
{{< / highlight >}}
```

According to the comment, a `git pull` would now rename the file for other OS X users as well.

@@ -50,4 +50,4 @@ Here's a slightly rewritten version of the step-by-step list found in the articl
7. Ensure "Sparse bundle disk image" is set in "Image Format".
8. Save it somewhere on your hard drive

The final step is to move any Git repositories to this new disk image. Any problems you've had with case-sensitivity will now be history.
The final step is to move any Git repositories to this new disk image. Any problems you've had with case-sensitivity will now be history.

+ 7
- 7
content/post/2014-09-03-opening-sublime-text-from-the-command-line.md View File

@@ -5,7 +5,7 @@ tags:
- sublime text
- mac
- command lin
- quick tip
- reference
title: Opening Sublime Text from the command line
url: /2014/09/03/opening-sublime-text-from-the-command-line/
---
@@ -14,9 +14,9 @@ I'm using [Sublime Text 3 beta](http://www.sublimetext.com/3) as my text editor.

Here's how you can open Sublime Text from the command line:

{{< highlight bash >}}
```shell
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
{{< / highlight >}}
```

(if you're using Sublime Text 2, just replace the path in the first argument)

@@ -24,16 +24,16 @@ If you would rather like to use another name for the command that opens Sublime

For this to work you must have `/usr/local/bin` in your $PATH environment variable. To check if it's already there, type this into your command line:

{{< highlight bash >}}
```shell
echo $PATH | grep -q "/usr/local/bin"
{{< / highlight >}}
```

If nothing is returned, you must add `/usr/local/bin` to $PATH. I'm not going to cover how you do this, because there are probably hundreds of other sites that does.

When everything is set up, you can type any of the following in your terminal:

{{< highlight bash >}}
```shell
subl <filename> # Opens a file
subl <foldername> # Opens a folder
subl . # Opens the current folder
{{< / highlight >}}
```

+ 10
- 10
content/post/2015-06-14-locationpicker.js.md View File

@@ -28,32 +28,32 @@ locationpicker.js requires [jQuery](http://jquery.com/) and the [Google Maps API
## Usage
These are the scripts you need to include in your HTML file:

{{< highlight html >}}
```html
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="//maps.google.com/maps/api/js?sensor=false&libraries=places"></script>
<script src="js/locationpicker.js"></script>
{{< / highlight >}}
```

In addition, you'll need to insert a container that will hold the actual map from Google Maps:

{{< highlight html >}}
```html
<div id="myMap"></div>
{{< / highlight >}}
```

The map container can be styled using CSS.

The last thing you need to do is to load the locationpicker.js plugin:

{{< highlight html >}}
```html
<script>
$('#myMap').locationpicker({ options });
</script>
{{< / highlight >}}
```

## Options
You can configure locationpicker.js with a few options. Here are the defaults:

{{< highlight js >}}
```js
location: {
latitude: 69.675366,
longitude: 18.975428
@@ -81,7 +81,7 @@ circleOptions: {
},
afterLoad: function(currentLocation, radius) {},
afterChange: function(currentLocation, radius) {},
{{< / highlight >}}
```

**location { latitude, longitude }** (default: 69.675366, 18.975428)
The coordinates that will be loaded when the map is first displayed.
@@ -149,13 +149,13 @@ A callback function that is called every time the location or radius changes. `c
## Address search
The plugins also supports searching for a location by providing the address. Here's an example of how to do that:

{{< highlight js >}}
```js
$('#myMap').locationpicker('address', 'Karl Johans gate 1, Oslo, Norway', function(e) {
if (e.noResults) {
// No results found, alert the user.
}
});
{{< / highlight >}}
```

If Google Maps' geocoder is able to find a location, the first location returned from Google will be selected in the map. If not, the object `e` will have a property called `noResults` with the value `true`.


+ 2
- 2
content/post/2015-06-14-using-launchctl-on-mac-osx-10-10.markdown View File

@@ -18,7 +18,7 @@ After I finally got everything set up (easier said than done), I needed a way to
make offlineimap synchronize my mailbox periodically. Apple recommends using __launchctl__
instead of crontab. The following example shows how to run __offlineimap__ in quiet mode every two minutes:

{{< highlight xml >}}
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@@ -35,7 +35,7 @@ instead of crontab. The following example shows how to run __offlineimap__ in qu
<integer>120</integer>
</dict>
</plist>
{{< / highlight >}}
```

This file is basically an XML file, but the extension you must use is `.plist`. You would typically call it something like _com.yourname.scriptname.plist_. Place it in the folder `~/Library/LaunchAgents/`, and make sure you replace _yourname_ and _scriptname_ with something relevant.


+ 6
- 6
content/post/2015-06-21-mutt-tips-and-tricks.md View File

@@ -56,13 +56,13 @@ to apply the next operation to all tagged messages. The default keybinding for

Here's an example of how to tag all unread messages and mark them as read:

{{< highlight bash >}}
```bash
T # Invokes the tag-pattern function
~N # Tags all unread messages
; # tag-prefix operator, next operation will be applied to all tagged messages
W # Clear flag
N # Clear the N (unread) flag
{{< / highlight >}}
```

<a name="untagging"></a>Untagging messages
==========
@@ -80,17 +80,17 @@ After you've installed [mutt][] with this patch, it's very simple to change the
signature attachment's filename. All you have to do is add the following line to
your `.muttrc`:

{{< highlight bash >}}
```bash
set pgp_mime_signature_filename = 'signature.asc'
{{< / highlight >}}
```

<a name="from-specific-signatures"></a>"From"-specific signatures
------------------------------------
I have different email addresses based on what "role" I have. One (with several aliases) is for personal stuff, one is for work related stuff and one is for my freelance company. I'd like [mutt][] to change my signature based on which address I send the email from. This is also fairly easy to accomplish. Just add the following line to `.muttrc` for each account you would like a specific signature for:

{{< highlight bash >}}
```bash
send-hook "~f from@address1.com" 'set signature=~/.mutt/signature_for_address1'
{{< / highlight >}}
```

This will tell [mutt][] that *"whenever I send a message from
`from@address1.com`, use the signature in the file

+ 14
- 14
content/post/2015-08-09-basic-usage-of-git-svn.md View File

@@ -15,43 +15,43 @@ This is a small guide I wrote for my own convenience when I recently was convert
I've found most of these examples in the excellent official [git-svn documentation](http://git-scm.com/docs/git-svn).

## Cloning the SVN repository
{{< highlight bash >}}
```shell
git svn clone <repo-url>
{{< / highlight >}}
```

## Adding another remote
{{< highlight bash >}}
```shell
git remote add <remote-name> <remote-url>
{{< / highlight >}}
```

## Fetching and rebasing changes from SVN
{{< highlight bash >}}
```shell
git svn fetch && git svn rebase
{{< / highlight >}}
```
Note that the git-svn documentation has a section discussing rebase vs pull/merge:

> Prefer to use git svn rebase or git rebase, rather than git pull or git merge to synchronize unintegrated commits with a git svn branch. Doing so will keep the history of unintegrated commits linear with respect to the upstream SVN repository and allow the use of the preferred git svn dcommit subcommand to push unintegrated commits back into SVN.

## Doing work and pushing to SVN
{{< highlight bash >}}
```shell
git add <file>
git commit -m "<commit message>"
git svn dcommit # This will push your changes to the SVN repository
{{< / highlight >}}
```

## Pushing to other remotes
{{< highlight bash >}}
```shell
git push <remote-name>
{{< / highlight >}}
```

## See what will be pushed to SVN
{{< highlight bash >}}
```shell
git diff git-svn HEAD # Assuming your remote SVN branch is called git-svn
{{< / highlight >}}
```
[http://stackoverflow.com/a/9776318/1094451](http://stackoverflow.com/a/9776318/1094451)

{{< highlight bash >}}
```shell
git svn dcommit --dry-run
{{< / highlight >}}
```
[http://stackoverflow.com/a/6040113/1094451](http://stackoverflow.com/a/6040113/1094451)


+ 5
- 4
content/post/2015-08-09-deleteing-rows-with-a-left-join-in-mysql.markdown View File

@@ -6,6 +6,7 @@ tags:
- mysql
- sql
- database
- reference
title: Deleting rows with a LEFT JOIN in MySQL
url: /2015/08/09/deleteing-rows-with-a-left-join-in-mysql/
---
@@ -16,14 +17,14 @@ Let's say you have a table **images** and a table **users**. Now you want to del

First, I usually do a visual inspection of the rows that will be deleted:

{{< highlight sql >}}
```sql
SELECT i.* FROM images i LEFT JOIN users u ON i.user_id = u.id WHERE u.deleted = 1;
{{< / highlight >}}
```

The rows returned by this query are the rows that will be deleted when you run the following query:

{{< highlight sql >}}
```sql
DELETE i FROM images i LEFT JOIN users u ON i.user_id = u.id WHERE u.deleted = 1;
{{< / highlight >}}
```

They key part here is to specify which table you want to delete from. In this case it's the table `i`, which is the `images` table.

+ 2
- 2
content/post/2015-08-09-useful-git-tips.md View File

@@ -14,7 +14,7 @@ This is a collection of useful git commands, aliases, tips and tricks that I've
## Aliases for ignoring files
To prevent changes in already-commited files from being commited, you can update your index with the `--assume-unchaged` flag for the files that you don't want to commit. Here are a couple of useful aliases for dealing with this.

```bash
```shell
ignore = !git update-index --assume-unchanged
unignore = !git update-index --no-assume-unchanged
ignored = !git ls-files -v | grep ^[a-z]
@@ -29,6 +29,6 @@ Source: [http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.
## Commit partial changes
If you want to only commit certain changes in a file, you can use the following command:

```bash
```shell
git add -p <files>
```

+ 12
- 12
content/post/2016-01-21-creating-a-bootable-usb-stick-on-os-x.md View File

@@ -6,7 +6,7 @@ tags:
- usb
- boot
- mac
- tips
- reference
title: Creating a bootable USB stick on OS X
url: /2016/01/21/creating-a-bootable-usb-stick-on-os-x/
---
@@ -16,9 +16,9 @@ Here's a simple way to create a bootable USB stick from a downloaded .ISO file o
## Convert ISO to IMG
Open the terminal and type the following command:

{{< highlight bash >}}
```bash
hdiutil convert -format UDRW -o target.img source.iso
{{< / highlight >}}
```

Remember to replace the paths in the previous example.

@@ -28,21 +28,21 @@ Remember to replace the paths in the previous example.

First, find the correct device node:

{{< highlight bash >}}
diskutil list
{{< / highlight >}}
```shell
diskutil list
```

After you have successfully identified your USB stick, unmount the disk (replace *N* with the disk number):

{{< highlight bash >}}
diskutil unmountDisk /dev/diskN
{{< / highlight >}}
```shell
diskutil unmountDisk /dev/diskN
```

Finally, transfer the image to the USB stick (again, replace *N* with the disk number):

{{< highlight bash >}}
sudo dd if=target.img of=/dev/rdiskN bs=1m
{{< / highlight >}}
```shell
sudo dd if=target.img of=/dev/rdiskN bs=1m
```

After a short while, depending on the image size, your USB stick will be ready to use as a bootable media.


+ 24
- 0
content/post/2018-02-09-ubuntu-sudo-nopasswd.md View File

@@ -0,0 +1,24 @@
+++
date = "2018-02-09T22:12:00+02:00"
description = "Reference"
title = "Disabling password for sudo in Ubuntu"
tags = ["ubuntu", "linux", "sudo", "reference"]
+++

Disabling the password needed for `sudo` for a specific user is very easy in Ubuntu. This method applies to Ubuntu 16.04, but probably also other versions of Ubuntu and maybe even other distros.

First, run the following command:

```shell
sudo visudo
```

> **Note:** If this is the first time you're running this command, you'll most likely be presented with a list of editors to choose from. Choose the one you're most comfortable with.

Then enter the following line **at the end of the file**:

```shell
user ALL=(ALL:ALL) NOPASSWD:ALL
```

Make sure to replace *user* with the username of the user you want to allow using `sudo` without entering a password.

+ 9
- 9
content/post/ludum-dare-38.md View File

@@ -44,19 +44,19 @@ Here's a breakdown of the different tools I used:
* Evernote

## Summary
It was a really fun and challenging experience. As a beginner with both Unity and Blender, I spent most of the time figuring out how to do some of the most basic things. Time spent in Blender was probably around 60%. I really wanted to spend more time making the game more exciting and fun to play, but I just couldn't fit it in. I probably should have submitted to the jam, which would have given me 24 hours more to work with the game, but since I had other plans for the next day, I didn't see any reason to do so.
It was a really fun and challenging experience. As a beginner with both Unity and Blender, I spent most of the time figuring out how to do some of the most basic things. Time spent in Blender was probably around 60%. I really wanted to spend more time making the game more exciting and fun to play, but I just couldn't fit it in. I probably should have submitted to the jam, which would have given me 24 hours more to work with the game, but since I had other plans for the next day, I didn't see any reason to do so.

I'm already looking forward to the next event.
I'm already looking forward to the next event.

## Links
**Ludum Dare entry**
https://ldjam.com/events/ludum-dare/38/parking-zone
**Ludum Dare entry**
https://ldjam.com/events/ludum-dare/38/parking-zone

**Source code**
https://github.com/kimgrytoyr/LD38---Parking-Zone
**Source code**
https://github.com/kimgrytoyr/LD38---Parking-Zone

**Downloads**
**Downloads**

* [Windows](/files/LD38/ParkingZone.exe)
* [Mac](/files/LD38/Parkingzone.app.zip)
* [Windows](/files/LD38/ParkingZone.exe)
* [Mac](/files/LD38/Parkingzone.app.zip)
* [Linux](/files/LD38/ParkingZone.x86)

+ 1
- 1
invalidate_cahe.sh View File

@@ -1,3 +1,3 @@
#!/bin/bash
distribution_id="E1B9KWNF6O30FL" # Cloudfront distribution ID
aws cloudfront create-invalidation --distribution-id $distribution_id --paths "*" >/dev/null
aws cloudfront create-invalidation --distribution-id $distribution_id --paths "$1" >/dev/null

+ 36
- 31
public/2014/07/08/going-static/index.html View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Kim Grytøyr">
<meta name="description" content="Personal website for Kim Grytøyr.">
<meta name="generator" content="Hugo 0.20" />
<meta name="generator" content="Hugo 0.36" />
<title>Going static &middot; Kim Grytøyr</title>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
@@ -18,18 +18,17 @@

<link href="/index.xml" rel="alternate" type="application/rss+xml" title="Kim Grytøyr" />

<meta property="og:title" content="Going static" />
<meta property="og:description" content="My personal homepage has been powered by Wordpress for several years. There&rsquo;s nothing wrong with Wordpress, it&rsquo;s a mature blogging platform with a plethora of plugins and themes to choose from. Nevertheless, lately I&rsquo;ve been wanting to use a static site generator for my personal homepage. Here are some of the reasons why:
I want to use Markdown I want to use my favorite editor when writing I can easily store my homepage source in a Git repository or in Dropbox I can easily host it anywhere Now, most of these things can also be accomplished using Wordpress, but I find the concept of using a static site generator quite interesting, so I&rsquo;ve decided to give it a go." />
<meta property="og:description" content="Update 2018-02-09: The information in this post is no longer current. Please read this post for information about my current setup.
My personal homepage has been powered by Wordpress for several years. There&rsquo;s nothing wrong with Wordpress, it&rsquo;s a mature blogging platform with a plethora of plugins and themes to choose from. Nevertheless, lately I&rsquo;ve been wanting to use a static site generator for my personal homepage. Here are some of the reasons why:" />
<meta property="og:type" content="article" />
<meta property="og:url" content="/2014/07/08/going-static/" />



<meta property="article:published_time" content="2014-07-08T23:13:00&#43;00:00"/>

<meta property="article:modified_time" content="2014-07-08T23:13:00&#43;00:00"/>


@@ -45,27 +44,22 @@
<meta itemprop="name" content="Going static">
<meta itemprop="description" content="My personal homepage has been powered by Wordpress for several years. There&rsquo;s nothing wrong with Wordpress, it&rsquo;s a mature blogging platform with a plethora of plugins and themes to choose from. Nevertheless, lately I&rsquo;ve been wanting to use a static site generator for my personal homepage. Here are some of the reasons why:
I want to use Markdown I want to use my favorite editor when writing I can easily store my homepage source in a Git repository or in Dropbox I can easily host it anywhere Now, most of these things can also be accomplished using Wordpress, but I find the concept of using a static site generator quite interesting, so I&rsquo;ve decided to give it a go.">
<meta itemprop="description" content="Update 2018-02-09: The information in this post is no longer current. Please read this post for information about my current setup.
My personal homepage has been powered by Wordpress for several years. There&rsquo;s nothing wrong with Wordpress, it&rsquo;s a mature blogging platform with a plethora of plugins and themes to choose from. Nevertheless, lately I&rsquo;ve been wanting to use a static site generator for my personal homepage. Here are some of the reasons why:">


<meta itemprop="datePublished" content="2014-07-08T23:13:00&#43;00:00" />
<meta itemprop="dateModified" content="2014-07-08T23:13:00&#43;00:00" />
<meta itemprop="wordCount" content="193">

<meta itemprop="wordCount" content="214">


<meta itemprop="keywords" content="posts,posts-development,posts-email,posts-linux,projects,3d,3d-book,aws,blender,boot,case-sensitivity,cloudfront,command-lin,command-line,database,disk-image,email,gamedev,geodecoding,git,git-svn,hugo,javascript,jekyll,kernel,linux,ludum-dare,mac,mutt,mysql,quick-tip,s3,sql,static,sublime-text,svn,tips,unity,usb," />


<meta name="twitter:card" content="summary"/>

<meta itemprop="keywords" content="jekyll,static," />


<meta name="twitter:text:title" content="Going static"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Going static"/>
<meta name="twitter:description" content="My personal homepage has been powered by Wordpress for several years. There&rsquo;s nothing wrong with Wordpress, it&rsquo;s a mature blogging platform with a plethora of plugins and themes to choose from. Nevertheless, lately I&rsquo;ve been wanting to use a static site generator for my personal homepage. Here are some of the reasons why:
I want to use Markdown I want to use my favorite editor when writing I can easily store my homepage source in a Git repository or in Dropbox I can easily host it anywhere Now, most of these things can also be accomplished using Wordpress, but I find the concept of using a static site generator quite interesting, so I&rsquo;ve decided to give it a go."/>
<meta name="twitter:description" content="Update 2018-02-09: The information in this post is no longer current. Please read this post for information about my current setup.
My personal homepage has been powered by Wordpress for several years. There&rsquo;s nothing wrong with Wordpress, it&rsquo;s a mature blogging platform with a plethora of plugins and themes to choose from. Nevertheless, lately I&rsquo;ve been wanting to use a static site generator for my personal homepage. Here are some of the reasons why:"/>
<meta name="twitter:site" content="@https://www.twitter.com/kimgrytoyr"/>

</head>
@@ -82,10 +76,9 @@

<a class="cta" href="/index.xml">Subscribe</a>
</nav>


<section id="wrapper">
<article class="post">
<header>
@@ -105,7 +98,11 @@
</h2>
</header>
<section id="post-body">
<p>My personal homepage has been powered by <a href="https://wordpress.org">Wordpress</a> for several years. There&rsquo;s nothing wrong with Wordpress, it&rsquo;s a mature blogging platform with a plethora of plugins and themes to choose from. Nevertheless, lately I&rsquo;ve been wanting to use a static site generator for my personal homepage. Here are some of the reasons why:</p>
<blockquote>
<p><strong>Update 2018-02-09:</strong> The information in this post is no longer current. Please read <a href="/post/new-website-platform/">this post</a> for information about my current setup.</p>
</blockquote>

<p>My personal homepage has been powered by <a href="https://wordpress.org">Wordpress</a> for several years. There&rsquo;s nothing wrong with Wordpress, it&rsquo;s a mature blogging platform with a plethora of plugins and themes to choose from. Nevertheless, lately I&rsquo;ve been wanting to use a static site generator for my personal homepage. Here are some of the reasons why:</p>

<ul>
<li>I want to use Markdown</li>
@@ -153,6 +150,13 @@
<li>
<a href="/post/2018-02-09-ubuntu-sudo-nopasswd/">Disabling password for sudo in Ubuntu<aside class="dates">Feb 9</aside></a>
</li>
<li>
<a href="/post/2017-07-30-ludum-dare-39/">Ludum Dare 39: PowerClick<aside class="dates">Jul 30</aside></a>
</li>
@@ -214,13 +218,6 @@
</li>
<li>
<a href="/2015/08/09/basic-usage-of-git-svn/">Basic usage of git-svn<aside class="dates">Aug 9</aside></a>
</li>
</ul>

<footer id="footer">
@@ -249,17 +246,25 @@
<p class="small">
© Copyright 2017 Kim Grytøyr
© Copyright 2018 Kim Grytøyr
</p>
</footer>

</section>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/main.js"></script>
<script src="/js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/instantclick.min.js" data-no-instant></script>
<script>
InstantClick.on('change', function() {
setTimeout(function() {
hljs.initHighlighting();
}, 100);
});
</script>
<script data-no-instant>InstantClick.init();</script>




+ 30
- 31
public/2014/07/09/case-sensitivty-problem-with-git-in-os-x/index.html View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Kim Grytøyr">
<meta name="description" content="Personal website for Kim Grytøyr.">
<meta name="generator" content="Hugo 0.20" />
<meta name="generator" content="Hugo 0.36" />
<title>Case-sensitivity problem with Git in OS X &middot; Kim Grytøyr</title>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
@@ -18,8 +18,6 @@

<link href="/index.xml" rel="alternate" type="application/rss+xml" title="Kim Grytøyr" />

<meta property="og:title" content="Case-sensitivity problem with Git in OS X" />
<meta property="og:description" content="I&rsquo;ve several times experienced problems with files and folders having incorrect case in Git repositories in OS X, so I decided to gather some possible fixes and solutions to this problem. If you have any suggestions or comments, please consider sharing it with me in a comment.
@@ -31,6 +29,7 @@ git mv filename filename_tmp git mv filename_tmp Filename git commit -m &quot;Se


<meta property="article:published_time" content="2014-07-09T02:18:36&#43;00:00"/>

<meta property="article:modified_time" content="2014-07-09T02:18:36&#43;00:00"/>


@@ -51,20 +50,15 @@ Hacks First off, here&rsquo;s a solution published at Coderwall.com:
git mv filename filename_tmp git mv filename_tmp Filename git commit -m &quot;Set correct case for filename&quot; The author mentions that this is a hack and that it could possibly mess up other users&rsquo; repositories, and that a git pull by other users won&rsquo;t include this change.">


<meta itemprop="datePublished" content="2014-07-09T02:18:36&#43;00:00" />
<meta itemprop="dateModified" content="2014-07-09T02:18:36&#43;00:00" />
<meta itemprop="wordCount" content="317">



<meta itemprop="keywords" content="posts,posts-development,posts-email,posts-linux,projects,3d,3d-book,aws,blender,boot,case-sensitivity,cloudfront,command-lin,command-line,database,disk-image,email,gamedev,geodecoding,git,git-svn,hugo,javascript,jekyll,kernel,linux,ludum-dare,mac,mutt,mysql,quick-tip,s3,sql,static,sublime-text,svn,tips,unity,usb," />


<meta name="twitter:card" content="summary"/>


<meta itemprop="keywords" content="git,mac,case-sensitivity,disk image," />

<meta name="twitter:text:title" content="Case-sensitivity problem with Git in OS X"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Case-sensitivity problem with Git in OS X"/>
<meta name="twitter:description" content="I&rsquo;ve several times experienced problems with files and folders having incorrect case in Git repositories in OS X, so I decided to gather some possible fixes and solutions to this problem. If you have any suggestions or comments, please consider sharing it with me in a comment.
Hacks First off, here&rsquo;s a solution published at Coderwall.com:
@@ -85,10 +79,9 @@ git mv filename filename_tmp git mv filename_tmp Filename git commit -m &quot;Se

<a class="cta" href="/index.xml">Subscribe</a>
</nav>


<section id="wrapper">
<article class="post">
<header>
@@ -120,20 +113,18 @@ git mv filename filename_tmp git mv filename_tmp Filename git commit -m &quot;Se

<p>First off, here&rsquo;s a solution published at <a href="https://coderwall.com/p/mgi8ja">Coderwall.com</a>:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>git mv filename filename_tmp
<pre><code class="language-shell">git mv filename filename_tmp
git mv filename_tmp Filename
git commit -m <span style="color: #e6db74">&quot;Set correct case for filename&quot;</span>
</pre></div>

git commit -m &quot;Set correct case for filename&quot;
</code></pre>

<p>The author mentions that this is a hack and that it could possibly mess up other users&rsquo; repositories, and that a <code>git pull</code> by other users won&rsquo;t include this change.</p>

<p>In a comment to that article, a user suggests the following approach instead:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>git mv --force filename Filename
git commit -m <span style="color: #e6db74">&quot;Set correct case for filename&quot;</span>
</pre></div>

<pre><code class="language-shell">git mv --force filename Filename
git commit -m &quot;Set correct case for filename&quot;
</code></pre>

<p>According to the comment, a <code>git pull</code> would now rename the file for other OS X users as well.</p>

@@ -191,6 +182,13 @@ git commit -m <span style="color: #e6db74">&quot;Set correct case for filename&q
<li>
<a href="/post/2018-02-09-ubuntu-sudo-nopasswd/">Disabling password for sudo in Ubuntu<aside class="dates">Feb 9</aside></a>
</li>
<li>
<a href="/post/2017-07-30-ludum-dare-39/">Ludum Dare 39: PowerClick<aside class="dates">Jul 30</aside></a>
</li>
@@ -252,13 +250,6 @@ git commit -m <span style="color: #e6db74">&quot;Set correct case for filename&q
</li>
<li>
<a href="/2015/08/09/basic-usage-of-git-svn/">Basic usage of git-svn<aside class="dates">Aug 9</aside></a>
</li>
</ul>

<footer id="footer">
@@ -287,17 +278,25 @@ git commit -m <span style="color: #e6db74">&quot;Set correct case for filename&q
<p class="small">
© Copyright 2017 Kim Grytøyr
© Copyright 2018 Kim Grytøyr
</p>
</footer>

</section>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/main.js"></script>
<script src="/js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/instantclick.min.js" data-no-instant></script>
<script>
InstantClick.on('change', function() {
setTimeout(function() {
hljs.initHighlighting();
}, 100);
});
</script>
<script data-no-instant>InstantClick.init();</script>




+ 33
- 35
public/2014/09/03/opening-sublime-text-from-the-command-line/index.html View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Kim Grytøyr">
<meta name="description" content="Personal website for Kim Grytøyr.">
<meta name="generator" content="Hugo 0.20" />
<meta name="generator" content="Hugo 0.36" />
<title>Opening Sublime Text from the command line &middot; Kim Grytøyr</title>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
@@ -18,8 +18,6 @@

<link href="/index.xml" rel="alternate" type="application/rss+xml" title="Kim Grytøyr" />

<meta property="og:title" content="Opening Sublime Text from the command line" />
<meta property="og:description" content="I&rsquo;m using Sublime Text 3 beta as my text editor. It&rsquo;s fast and lightweight, but at the same time it&rsquo;s very powerful.
@@ -32,6 +30,7 @@ If you would rather like to use another name for the command that opens Sublime


<meta property="article:published_time" content="2014-09-03T20:53:36&#43;00:00"/>

<meta property="article:modified_time" content="2014-09-03T20:53:36&#43;00:00"/>


@@ -53,20 +52,15 @@ ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local
If you would rather like to use another name for the command that opens Sublime Text, just change the last part (subl) of this command to whatever you want.">


<meta itemprop="datePublished" content="2014-09-03T20:53:36&#43;00:00" />
<meta itemprop="dateModified" content="2014-09-03T20:53:36&#43;00:00" />
<meta itemprop="wordCount" content="175">



<meta itemprop="keywords" content="posts,posts-development,posts-email,posts-linux,projects,3d,3d-book,aws,blender,boot,case-sensitivity,cloudfront,command-lin,command-line,database,disk-image,email,gamedev,geodecoding,git,git-svn,hugo,javascript,jekyll,kernel,linux,ludum-dare,mac,mutt,mysql,quick-tip,s3,sql,static,sublime-text,svn,tips,unity,usb," />


<meta name="twitter:card" content="summary"/>


<meta itemprop="keywords" content="sublime text,mac,command lin,reference," />

<meta name="twitter:text:title" content="Opening Sublime Text from the command line"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Opening Sublime Text from the command line"/>
<meta name="twitter:description" content="I&rsquo;m using Sublime Text 3 beta as my text editor. It&rsquo;s fast and lightweight, but at the same time it&rsquo;s very powerful.
Here&rsquo;s how you can open Sublime Text from the command line:
@@ -88,10 +82,9 @@ If you would rather like to use another name for the command that opens Sublime

<a class="cta" href="/index.xml">Subscribe</a>
</nav>


<section id="wrapper">
<article class="post">
<header>
@@ -108,7 +101,7 @@ If you would rather like to use another name for the command that opens Sublime
<a href="/tags/command-lin">command lin</a>
<a href="/tags/quick-tip">quick tip</a>
<a href="/tags/reference">reference</a>
@@ -119,9 +112,8 @@ If you would rather like to use another name for the command that opens Sublime

<p>Here&rsquo;s how you can open Sublime Text from the command line:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>ln -s /Applications/Sublime<span style="color: #ae81ff">\ </span>Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
</pre></div>

<pre><code class="language-shell">ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
</code></pre>

<p>(if you&rsquo;re using Sublime Text 2, just replace the path in the first argument)</p>

@@ -129,19 +121,17 @@ If you would rather like to use another name for the command that opens Sublime

<p>For this to work you must have <code>/usr/local/bin</code> in your $PATH environment variable. To check if it&rsquo;s already there, type this into your command line:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">echo</span> <span style="color: #f8f8f2">$PATH</span> <span style="color: #f8f8f2">|</span> grep -q <span style="color: #e6db74">&quot;/usr/local/bin&quot;</span>
</pre></div>

<pre><code class="language-shell">echo $PATH | grep -q &quot;/usr/local/bin&quot;
</code></pre>

<p>If nothing is returned, you must add <code>/usr/local/bin</code> to $PATH. I&rsquo;m not going to cover how you do this, because there are probably hundreds of other sites that does.</p>

<p>When everything is set up, you can type any of the following in your terminal:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>subl &lt;filename&gt; <span style="color: #75715e"># Opens a file</span>
subl &lt;foldername&gt; <span style="color: #75715e"># Opens a folder</span>
subl . <span style="color: #75715e"># Opens the current folder</span>
</pre></div>

<pre><code class="language-shell">subl &lt;filename&gt; # Opens a file
subl &lt;foldername&gt; # Opens a folder
subl . # Opens the current folder
</code></pre>

</section>
</article>
@@ -176,6 +166,13 @@ subl . <span style="color: #75715e"># Opens the current folder</span>
<li>
<a href="/post/2018-02-09-ubuntu-sudo-nopasswd/">Disabling password for sudo in Ubuntu<aside class="dates">Feb 9</aside></a>
</li>
<li>
<a href="/post/2017-07-30-ludum-dare-39/">Ludum Dare 39: PowerClick<aside class="dates">Jul 30</aside></a>
</li>
@@ -237,13 +234,6 @@ subl . <span style="color: #75715e"># Opens the current folder</span>
</li>
<li>
<a href="/2015/08/09/basic-usage-of-git-svn/">Basic usage of git-svn<aside class="dates">Aug 9</aside></a>
</li>
</ul>

<footer id="footer">
@@ -272,17 +262,25 @@ subl . <span style="color: #75715e"># Opens the current folder</span>
<p class="small">
© Copyright 2017 Kim Grytøyr
© Copyright 2018 Kim Grytøyr
</p>
</footer>

</section>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/main.js"></script>
<script src="/js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/instantclick.min.js" data-no-instant></script>
<script>
InstantClick.on('change', function() {
setTimeout(function() {
hljs.initHighlighting();
}, 100);
});
</script>
<script data-no-instant>InstantClick.init();</script>




+ 68
- 72
public/2015/06/14/locationpicker.js/index.html View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Kim Grytøyr">
<meta name="description" content="Personal website for Kim Grytøyr.">
<meta name="generator" content="Hugo 0.20" />
<meta name="generator" content="Hugo 0.36" />
<title>locationpicker.js &middot; Kim Grytøyr</title>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
@@ -18,8 +18,6 @@

<link href="/index.xml" rel="alternate" type="application/rss+xml" title="Kim Grytøyr" />

<meta property="og:title" content="locationpicker.js" />
<meta property="og:description" content="locationpicker.js is a simple-to-use jQuery plugin that allows you to select a location on a map and receive the coordinates using a callback function. It also supports searching for a location based on an address.
@@ -35,6 +33,7 @@ Requirements locationpicker.js requires jQuery and the Google Maps API to work."


<meta property="article:published_time" content="2015-06-14T16:40:00&#43;00:00"/>

<meta property="article:modified_time" content="2015-06-14T16:40:00&#43;00:00"/>


@@ -59,20 +58,15 @@ Fullscreen
Requirements locationpicker.js requires jQuery and the Google Maps API to work.">


<meta itemprop="datePublished" content="2015-06-14T16:40:00&#43;00:00" />
<meta itemprop="dateModified" content="2015-06-14T16:40:00&#43;00:00" />
<meta itemprop="wordCount" content="728">



<meta itemprop="keywords" content="posts,posts-development,posts-email,posts-linux,projects,3d,3d-book,aws,blender,boot,case-sensitivity,cloudfront,command-lin,command-line,database,disk-image,email,gamedev,geodecoding,git,git-svn,hugo,javascript,jekyll,kernel,linux,ludum-dare,mac,mutt,mysql,quick-tip,s3,sql,static,sublime-text,svn,tips,unity,usb," />


<meta name="twitter:card" content="summary"/>


<meta itemprop="keywords" content="javascript,geodecoding," />

<meta name="twitter:text:title" content="locationpicker.js"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="locationpicker.js"/>
<meta name="twitter:description" content="locationpicker.js is a simple-to-use jQuery plugin that allows you to select a location on a map and receive the coordinates using a callback function. It also supports searching for a location based on an address.
Repository To download the latest version of locationpicker.js, visit the repository:
@@ -97,10 +91,9 @@ Requirements locationpicker.js requires jQuery and the Google Maps API to work."

<a class="cta" href="/index.xml">Subscribe</a>
</nav>


<section id="wrapper">
<article class="post">
<header>
@@ -146,61 +139,57 @@ Requirements locationpicker.js requires jQuery and the Google Maps API to work."

<p>These are the scripts you need to include in your HTML file:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">script</span> <span style="color: #a6e22e">src</span><span style="color: #f92672">=</span><span style="color: #e6db74">&quot;//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js&quot;</span><span style="color: #f8f8f2">&gt;&lt;/</span><span style="color: #f92672">script</span><span style="color: #f8f8f2">&gt;</span>
<span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">script</span> <span style="color: #a6e22e">src</span><span style="color: #f92672">=</span><span style="color: #e6db74">&quot;//maps.google.com/maps/api/js?sensor=false&amp;libraries=places&quot;</span><span style="color: #f8f8f2">&gt;&lt;/</span><span style="color: #f92672">script</span><span style="color: #f8f8f2">&gt;</span>
<span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">script</span> <span style="color: #a6e22e">src</span><span style="color: #f92672">=</span><span style="color: #e6db74">&quot;js/locationpicker.js&quot;</span><span style="color: #f8f8f2">&gt;&lt;/</span><span style="color: #f92672">script</span><span style="color: #f8f8f2">&gt;</span>
</pre></div>

<pre><code class="language-html">&lt;script src=&quot;//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;//maps.google.com/maps/api/js?sensor=false&amp;libraries=places&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/locationpicker.js&quot;&gt;&lt;/script&gt;
</code></pre>

<p>In addition, you&rsquo;ll need to insert a container that will hold the actual map from Google Maps:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">div</span> <span style="color: #a6e22e">id</span><span style="color: #f92672">=</span><span style="color: #e6db74">&quot;myMap&quot;</span><span style="color: #f8f8f2">&gt;&lt;/</span><span style="color: #f92672">div</span><span style="color: #f8f8f2">&gt;</span>
</pre></div>

<pre><code class="language-html">&lt;div id=&quot;myMap&quot;&gt;&lt;/div&gt;
</code></pre>

<p>The map container can be styled using CSS.</p>

<p>The last thing you need to do is to load the locationpicker.js plugin:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">&lt;</span><span style="color: #f92672">script</span><span style="color: #f8f8f2">&gt;</span>
<span style="color: #a6e22e">$</span><span style="color: #f8f8f2">(</span><span style="color: #e6db74">&#39;#myMap&#39;</span><span style="color: #f8f8f2">).</span><span style="color: #a6e22e">locationpicker</span><span style="color: #f8f8f2">({</span> <span style="color: #a6e22e">options</span> <span style="color: #f8f8f2">});</span>
<span style="color: #f8f8f2">&lt;/</span><span style="color: #f92672">script</span><span style="color: #f8f8f2">&gt;</span>
</pre></div>

<pre><code class="language-html">&lt;script&gt;
$('#myMap').locationpicker({ options });
&lt;/script&gt;
</code></pre>

<h2 id="options">Options</h2>

<p>You can configure locationpicker.js with a few options. Here are the defaults:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #a6e22e">location</span><span style="color: #f92672">:</span> <span style="color: #f8f8f2">{</span>
<span style="color: #a6e22e">latitude</span><span style="color: #f92672">:</span> <span style="color: #ae81ff">69.675366</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">longitude</span><span style="color: #f92672">:</span> <span style="color: #ae81ff">18.975428</span>
<span style="color: #f8f8f2">},</span>
<span style="color: #a6e22e">minRadius</span><span style="color: #f92672">:</span> <span style="color: #ae81ff">15</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">maxRadius</span><span style="color: #f92672">:</span> <span style="color: #ae81ff">300</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">radius</span><span style="color: #f92672">:</span> <span style="color: #ae81ff">150</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">zoom</span><span style="color: #f92672">:</span> <span style="color: #ae81ff">15</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">zoomLevelAfterAddressResult</span><span style="color: #f92672">:</span> <span style="color: #ae81ff">15</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">markerTitle</span><span style="color: #f92672">:</span> <span style="color: #e6db74">&quot;Dra markøren til uteposten&quot;</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">draggable</span><span style="color: #f92672">:</span> <span style="color: #66d9ef">true</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">clickable</span><span style="color: #f92672">:</span> <span style="color: #66d9ef">true</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">mapType</span><span style="color: #f92672">:</span> <span style="color: #a6e22e">google</span><span style="color: #f8f8f2">.</span><span style="color: #a6e22e">maps</span><span style="color: #f8f8f2">.</span><span style="color: #a6e22e">MapTypeId</span><span style="color: #f8f8f2">.</span><span style="color: #a6e22e">NORMAL</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">mapTypeControl</span><span style="color: #f92672">:</span> <span style="color: #66d9ef">true</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">zoomControl</span><span style="color: #f92672">:</span> <span style="color: #66d9ef">true</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">panControl</span><span style="color: #f92672">:</span> <span style="color: #66d9ef">true</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">streetViewControl</span><span style="color: #f92672">:</span> <span style="color: #66d9ef">false</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">circleOptions</span><span style="color: #f92672">:</span> <span style="color: #f8f8f2">{</span>
<span style="color: #a6e22e">strokeColor</span><span style="color: #f92672">:</span> <span style="color: #e6db74">&quot;#0000FF&quot;</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">strokeOpacity</span><span style="color: #f92672">:</span> <span style="color: #ae81ff">0.45</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">strokeWeight</span><span style="color: #f92672">:</span> <span style="color: #ae81ff">2</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">fillColor</span><span style="color: #f92672">:</span> <span style="color: #e6db74">&quot;#0000FF&quot;</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">fillOpacity</span><span style="color: #f92672">:</span> <span style="color: #ae81ff">0.10</span><span style="color: #f8f8f2">,</span>
<span style="color: #a6e22e">editable</span><span style="color: #f92672">:</span> <span style="color: #66d9ef">true</span>
<span style="color: #f8f8f2">},</span>
<span style="color: #a6e22e">afterLoad</span><span style="color: #f92672">:</span> <span style="color: #66d9ef">function</span><span style="color: #f8f8f2">(</span><span style="color: #a6e22e">currentLocation</span><span style="color: #f8f8f2">,</span> <span style="color: #a6e22e">radius</span><span style="color: #f8f8f2">)</span> <span style="color: #f8f8f2">{},</span>
<span style="color: #a6e22e">afterChange</span><span style="color: #f92672">:</span> <span style="color: #66d9ef">function</span><span style="color: #f8f8f2">(</span><span style="color: #a6e22e">currentLocation</span><span style="color: #f8f8f2">,</span> <span style="color: #a6e22e">radius</span><span style="color: #f8f8f2">)</span> <span style="color: #f8f8f2">{},</span>
</pre></div>

<pre><code class="language-js">location: {
latitude: 69.675366,
longitude: 18.975428
},
minRadius: 15,
maxRadius: 300,
radius: 150,
zoom: 15,
zoomLevelAfterAddressResult: 15,
markerTitle: &quot;Dra markøren til uteposten&quot;,
draggable: true,
clickable: true,
mapType: google.maps.MapTypeId.NORMAL,
mapTypeControl: true,
zoomControl: true,
panControl: true,
streetViewControl: false,
circleOptions: {
strokeColor: &quot;#0000FF&quot;,
strokeOpacity: 0.45,
strokeWeight: 2,
fillColor: &quot;#0000FF&quot;,
fillOpacity: 0.10,
editable: true
},
afterLoad: function(currentLocation, radius) {},
afterChange: function(currentLocation, radius) {},
</code></pre>

<p><strong>location { latitude, longitude }</strong> (default: 69.675366, 18.975428)
The coordinates that will be loaded when the map is first displayed.</p>
@@ -270,13 +259,12 @@ A callback function that is called every time the location or radius changes. <c

<p>The plugins also supports searching for a location by providing the address. Here&rsquo;s an example of how to do that:</p>

<p><div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #a6e22e">$</span><span style="color: #f8f8f2">(</span><span style="color: #e6db74">&#39;#myMap&#39;</span><span style="color: #f8f8f2">).</span><span style="color: #a6e22e">locationpicker</span><span style="color: #f8f8f2">(</span><span style="color: #e6db74">&#39;address&#39;</span><span style="color: #f8f8f2">,</span> <span style="color: #e6db74">&#39;Karl Johans gate 1, Oslo, Norway&#39;</span><span style="color: #f8f8f2">,</span> <span style="color: #66d9ef">function</span><span style="color: #f8f8f2">(</span><span style="color: #a6e22e">e</span><span style="color: #f8f8f2">)</span> <span style="color: #f8f8f2">{</span>
<span style="color: #66d9ef">if</span> <span style="color: #f8f8f2">(</span><span style="color: #a6e22e">e</span><span style="color: #f8f8f2">.</span><span style="color: #a6e22e">noResults</span><span style="color: #f8f8f2">)</span> <span style="color: #f8f8f2">{</span>
<span style="color: #75715e">// No results found, alert the user.</span>
<span style="color: #f8f8f2">}</span>
<span style="color: #f8f8f2">});</span>
</pre></div>
</p>
<pre><code class="language-js">$('#myMap').locationpicker('address', 'Karl Johans gate 1, Oslo, Norway', function(e) {
if (e.noResults) {
// No results found, alert the user.
}
});
</code></pre>

<p>If Google Maps&rsquo; geocoder is able to find a location, the first location returned from Google will be selected in the map. If not, the object <code>e</code> will have a property called <code>noResults</code> with the value <code>true</code>.</p>

@@ -315,6 +303,13 @@ A callback function that is called every time the location or radius changes. <c
<li>
<a href="/post/2018-02-09-ubuntu-sudo-nopasswd/">Disabling password for sudo in Ubuntu<aside class="dates">Feb 9</aside></a>
</li>
<li>
<a href="/post/2017-07-30-ludum-dare-39/">Ludum Dare 39: PowerClick<aside class="dates">Jul 30</aside></a>
</li>
@@ -376,13 +371,6 @@ A callback function that is called every time the location or radius changes. <c
</li>
<li>
<a href="/2015/08/09/basic-usage-of-git-svn/">Basic usage of git-svn<aside class="dates">Aug 9</aside></a>
</li>
</ul>

<footer id="footer">
@@ -411,17 +399,25 @@ A callback function that is called every time the location or radius changes. <c
<p class="small">
© Copyright 2017 Kim Grytøyr
© Copyright 2018 Kim Grytøyr
</p>
</footer>

</section>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/main.js"></script>
<script src="/js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/instantclick.min.js" data-no-instant></script>
<script>
InstantClick.on('change', function() {
setTimeout(function() {
hljs.initHighlighting();
}, 100);
});
</script>
<script data-no-instant>InstantClick.init();</script>




+ 41
- 41
public/2015/06/14/using-launchctl-on-mac-osx-10-10/index.html View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Kim Grytøyr">
<meta name="description" content="Personal website for Kim Grytøyr.">
<meta name="generator" content="Hugo 0.20" />
<meta name="generator" content="Hugo 0.36" />
<title>Using launchctl on Mac OSX 10.10 to run a script periodically &middot; Kim Grytøyr</title>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
@@ -18,8 +18,6 @@

<link href="/index.xml" rel="alternate" type="application/rss+xml" title="Kim Grytøyr" />

<meta property="og:title" content="Using launchctl on Mac OSX 10.10 to run a script periodically" />
<meta property="og:description" content="Lately I&rsquo;ve been playing around with mutt, a &ldquo;small but powerful text-based email client for Unix operating systems&rdquo; and offlineimap, a software that downloads your mailbox as a local Maildir.
@@ -30,6 +28,7 @@ After I finally got everything set up (easier said than done), I needed a way to


<meta property="article:published_time" content="2015-06-14T15:26:36&#43;00:00"/>

<meta property="article:modified_time" content="2015-06-14T15:26:36&#43;00:00"/>


@@ -49,20 +48,15 @@ After I finally got everything set up (easier said than done), I needed a way to
After I finally got everything set up (easier said than done), I needed a way to make offlineimap synchronize my mailbox periodically. Apple recommends using launchctl instead of crontab. The following example shows how to run offlineimap in quiet mode every two minutes:">


<meta itemprop="datePublished" content="2015-06-14T15:26:36&#43;00:00" />
<meta itemprop="dateModified" content="2015-06-14T15:26:36&#43;00:00" />
<meta itemprop="wordCount" content="175">



<meta itemprop="keywords" content="posts,posts-development,posts-email,posts-linux,projects,3d,3d-book,aws,blender,boot,case-sensitivity,cloudfront,command-lin,command-line,database,disk-image,email,gamedev,geodecoding,git,git-svn,hugo,javascript,jekyll,kernel,linux,ludum-dare,mac,mutt,mysql,quick-tip,s3,sql,static,sublime-text,svn,tips,unity,usb," />


<meta name="twitter:card" content="summary"/>

<meta itemprop="keywords" content="mac,command line," />


<meta name="twitter:text:title" content="Using launchctl on Mac OSX 10.10 to run a script periodically"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Using launchctl on Mac OSX 10.10 to run a script periodically"/>
<meta name="twitter:description" content="Lately I&rsquo;ve been playing around with mutt, a &ldquo;small but powerful text-based email client for Unix operating systems&rdquo; and offlineimap, a software that downloads your mailbox as a local Maildir.
After I finally got everything set up (easier said than done), I needed a way to make offlineimap synchronize my mailbox periodically. Apple recommends using launchctl instead of crontab. The following example shows how to run offlineimap in quiet mode every two minutes:"/>
@@ -82,10 +76,9 @@ After I finally got everything set up (easier said than done), I needed a way to

<a class="cta" href="/index.xml">Subscribe</a>
</nav>


<section id="wrapper">
<article class="post">
<header>
@@ -114,24 +107,23 @@ as a local Maildir.</p>
make offlineimap synchronize my mailbox periodically. Apple recommends using <strong>launchctl</strong>
instead of crontab. The following example shows how to run <strong>offlineimap</strong> in quiet mode every two minutes:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #75715e">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span style="color: #75715e">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span>
<span style="color: #f92672">&lt;plist</span> <span style="color: #a6e22e">version=</span><span style="color: #e6db74">&quot;1.0&quot;</span><span style="color: #f92672">&gt;</span>
<span style="color: #f92672">&lt;dict&gt;</span>
<span style="color: #f92672">&lt;key&gt;</span>Label<span style="color: #f92672">&lt;/key&gt;</span>
<span style="color: #f92672">&lt;string&gt;</span>com.kimgrytoyr.offlineimap.plist<span style="color: #f92672">&lt;/string&gt;</span>
<span style="color: #f92672">&lt;key&gt;</span>ProgramArguments<span style="color: #f92672">&lt;/key&gt;</span>
<span style="color: #f92672">&lt;array&gt;</span>
<span style="color: #f92672">&lt;string&gt;</span>/usr/local/bin/offlineimap<span style="color: #f92672">&lt;/string&gt;</span>
<span style="color: #f92672">&lt;string&gt;</span>-u<span style="color: #f92672">&lt;/string&gt;</span>
<span style="color: #f92672">&lt;string&gt;</span>quiet<span style="color: #f92672">&lt;/string&gt;</span>
<span style="color: #f92672">&lt;/array&gt;</span>
<span style="color: #f92672">&lt;key&gt;</span>StartInterval<span style="color: #f92672">&lt;/key&gt;</span>
<span style="color: #f92672">&lt;integer&gt;</span>120<span style="color: #f92672">&lt;/integer&gt;</span>
<span style="color: #f92672">&lt;/dict&gt;</span>
<span style="color: #f92672">&lt;/plist&gt;</span>
</pre></div>

<pre><code class="language-xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
&lt;plist version=&quot;1.0&quot;&gt;
&lt;dict&gt;
&lt;key&gt;Label&lt;/key&gt;
&lt;string&gt;com.kimgrytoyr.offlineimap.plist&lt;/string&gt;
&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
&lt;string&gt;/usr/local/bin/offlineimap&lt;/string&gt;
&lt;string&gt;-u&lt;/string&gt;
&lt;string&gt;quiet&lt;/string&gt;
&lt;/array&gt;
&lt;key&gt;StartInterval&lt;/key&gt;
&lt;integer&gt;120&lt;/integer&gt;
&lt;/dict&gt;
&lt;/plist&gt;
</code></pre>

<p>This file is basically an XML file, but the extension you must use is <code>.plist</code>. You would typically call it something like <em>com.yourname.scriptname.plist</em>. Place it in the folder <code>~/Library/LaunchAgents/</code>, and make sure you replace <em>yourname</em> and <em>scriptname</em> with something relevant.</p>

@@ -176,6 +168,13 @@ instead of crontab. The following example shows how to run <strong>offlineimap</
<li>
<a href="/post/2018-02-09-ubuntu-sudo-nopasswd/">Disabling password for sudo in Ubuntu<aside class="dates">Feb 9</aside></a>
</li>
<li>
<a href="/post/2017-07-30-ludum-dare-39/">Ludum Dare 39: PowerClick<aside class="dates">Jul 30</aside></a>
</li>
@@ -237,13 +236,6 @@ instead of crontab. The following example shows how to run <strong>offlineimap</
</li>
<li>
<a href="/2015/08/09/basic-usage-of-git-svn/">Basic usage of git-svn<aside class="dates">Aug 9</aside></a>
</li>
</ul>

<footer id="footer">
@@ -272,17 +264,25 @@ instead of crontab. The following example shows how to run <strong>offlineimap</
<p class="small">
© Copyright 2017 Kim Grytøyr
© Copyright 2018 Kim Grytøyr
</p>
</footer>

</section>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/main.js"></script>
<script src="/js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/instantclick.min.js" data-no-instant></script>
<script>
InstantClick.on('change', function() {
setTimeout(function() {
hljs.initHighlighting();
}, 100);
});
</script>
<script data-no-instant>InstantClick.init();</script>




+ 34
- 36
public/2015/06/21/mutt-tips-and-tricks/index.html View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Kim Grytøyr">
<meta name="description" content="Personal website for Kim Grytøyr.">
<meta name="generator" content="Hugo 0.20" />
<meta name="generator" content="Hugo 0.36" />
<title>mutt tips &amp; tricks &middot; Kim Grytøyr</title>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
@@ -18,8 +18,6 @@

<link href="/index.xml" rel="alternate" type="application/rss+xml" title="Kim Grytøyr" />

<meta property="og:title" content="mutt tips &amp; tricks" />
<meta property="og:description" content="I&rsquo;ve been using mutt with offlineimap and msmtp (dead link, coming soon.) for a while now, and I want to use this post to collect some features and tips that I&rsquo;ve found myself often searching for.
@@ -30,6 +28,7 @@


<meta property="article:published_time" content="2015-06-21T00:10:00&#43;00:00"/>

<meta property="article:modified_time" content="2015-06-21T00:10:00&#43;00:00"/>


@@ -49,20 +48,15 @@
Finding messages in the current folder Common flags Tagging messages and doing bulk actions Untagging messages Changing the filename of the PGP signature attachment &ldquo;From&rdquo;-specific signatures Finding messages in the current folder The default keybinding for searching the current folder is l.">


<meta itemprop="datePublished" content="2015-06-21T00:10:00&#43;00:00" />
<meta itemprop="dateModified" content="2015-06-21T00:10:00&#43;00:00" />
<meta itemprop="wordCount" content="566">



<meta itemprop="keywords" content="posts,posts-development,posts-email,posts-linux,projects,3d,3d-book,aws,blender,boot,case-sensitivity,cloudfront,command-lin,command-line,database,disk-image,email,gamedev,geodecoding,git,git-svn,hugo,javascript,jekyll,kernel,linux,ludum-dare,mac,mutt,mysql,quick-tip,s3,sql,static,sublime-text,svn,tips,unity,usb," />


<meta name="twitter:card" content="summary"/>


<meta itemprop="keywords" content="mutt,email,tips," />

<meta name="twitter:text:title" content="mutt tips &amp; tricks"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="mutt tips &amp; tricks"/>
<meta name="twitter:description" content="I&rsquo;ve been using mutt with offlineimap and msmtp (dead link, coming soon.) for a while now, and I want to use this post to collect some features and tips that I&rsquo;ve found myself often searching for.
Finding messages in the current folder Common flags Tagging messages and doing bulk actions Untagging messages Changing the filename of the PGP signature attachment &ldquo;From&rdquo;-specific signatures Finding messages in the current folder The default keybinding for searching the current folder is l."/>
@@ -82,10 +76,9 @@

<a class="cta" href="/index.xml">Subscribe</a>
</nav>


<section id="wrapper">
<article class="post">
<header>
@@ -167,13 +160,12 @@ to apply the next operation to all tagged messages. The default keybinding for

<p>Here&rsquo;s an example of how to tag all unread messages and mark them as read:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>T <span style="color: #75715e"># Invokes the tag-pattern function</span>
~N <span style="color: #75715e"># Tags all unread messages</span>
<span style="color: #f8f8f2">;</span> <span style="color: #75715e"># tag-prefix operator, next operation will be applied to all tagged messages</span>
W <span style="color: #75715e"># Clear flag</span>
N <span style="color: #75715e"># Clear the N (unread) flag</span>
</pre></div>

<pre><code class="language-bash">T # Invokes the tag-pattern function
~N # Tags all unread messages
; # tag-prefix operator, next operation will be applied to all tagged messages
W # Clear flag
N # Clear the N (unread) flag
</code></pre>

<h1 id="a-name-untagging-a-untagging-messages"><a name="untagging"></a>Untagging messages</h1>

@@ -191,17 +183,15 @@ OS X with this patch in the post <a href="/posts/email/2015/06/20/my-mutt-setup.
signature attachment&rsquo;s filename. All you have to do is add the following line to
your <code>.muttrc</code>:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #f8f8f2">set</span> <span style="color: #f8f8f2">pgp_mime_signature_filename</span> <span style="color: #f92672">=</span> <span style="color: #e6db74">&#39;signature.asc&#39;</span>
</pre></div>

<pre><code class="language-bash">set pgp_mime_signature_filename = 'signature.asc'
</code></pre>

<h2 id="a-name-from-specific-signatures-a-from-specific-signatures"><a name="from-specific-signatures"></a>&ldquo;From&rdquo;-specific signatures</h2>

<p>I have different email addresses based on what &ldquo;role&rdquo; I have. One (with several aliases) is for personal stuff, one is for work related stuff and one is for my freelance company. I&rsquo;d like <a href="http://www.mutt.org/">mutt</a> to change my signature based on which address I send the email from. This is also fairly easy to accomplish. Just add the following line to <code>.muttrc</code> for each account you would like a specific signature for:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>send-hook <span style="color: #e6db74">&quot;~f from@address1.com&quot;</span> <span style="color: #e6db74">&#39;set signature=~/.mutt/signature_for_address1&#39;</span>
</pre></div>

<pre><code class="language-bash">send-hook &quot;~f from@address1.com&quot; 'set signature=~/.mutt/signature_for_address1'
</code></pre>

<p>This will tell <a href="http://www.mutt.org/">mutt</a> that <em>&ldquo;whenever I send a message from
<code>from@address1.com</code>, use the signature in the file
@@ -242,6 +232,13 @@ your <code>.muttrc</code>:</p>
<li>
<a href="/post/2018-02-09-ubuntu-sudo-nopasswd/">Disabling password for sudo in Ubuntu<aside class="dates">Feb 9</aside></a>
</li>
<li>
<a href="/post/2017-07-30-ludum-dare-39/">Ludum Dare 39: PowerClick<aside class="dates">Jul 30</aside></a>
</li>
@@ -303,13 +300,6 @@ your <code>.muttrc</code>:</p>
</li>
<li>
<a href="/2015/08/09/basic-usage-of-git-svn/">Basic usage of git-svn<aside class="dates">Aug 9</aside></a>
</li>
</ul>

<footer id="footer">
@@ -338,17 +328,25 @@ your <code>.muttrc</code>:</p>
<p class="small">
© Copyright 2017 Kim Grytøyr
© Copyright 2018 Kim Grytøyr
</p>
</footer>

</section>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/main.js"></script>
<script src="/js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/instantclick.min.js" data-no-instant></script>
<script>
InstantClick.on('change', function() {
setTimeout(function() {
hljs.initHighlighting();
}, 100);
});
</script>
<script data-no-instant>InstantClick.init();</script>




+ 43
- 46
public/2015/08/09/basic-usage-of-git-svn/index.html View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Kim Grytøyr">
<meta name="description" content="Personal website for Kim Grytøyr.">
<meta name="generator" content="Hugo 0.20" />
<meta name="generator" content="Hugo 0.36" />
<title>Basic usage of git-svn &middot; Kim Grytøyr</title>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
@@ -18,8 +18,6 @@

<link href="/index.xml" rel="alternate" type="application/rss+xml" title="Kim Grytøyr" />

<meta property="og:title" content="Basic usage of git-svn" />
<meta property="og:description" content="This is a small guide I wrote for my own convenience when I recently was converting an SVN repository to a Git repository. I&rsquo;ve published it here so that I can easily look up the things I need to remember..
@@ -31,6 +29,7 @@ Cloning the SVN repository git svn clone &lt;repo-url&gt; Adding another remote


<meta property="article:published_time" content="2015-08-09T15:13:36&#43;00:00"/>

<meta property="article:modified_time" content="2015-08-09T15:13:36&#43;00:00"/>


@@ -51,20 +50,15 @@ I&rsquo;ve found most of these examples in the excellent official git-svn docume
Cloning the SVN repository git svn clone &lt;repo-url&gt; Adding another remote git remote add &lt;remote-name&gt; &lt;remote-url&gt; Fetching and rebasing changes from SVN git svn fetch &amp;&amp; git svn rebase Note that the git-svn documentation has a section discussing rebase vs pull/merge:">


<meta itemprop="datePublished" content="2015-08-09T15:13:36&#43;00:00" />
<meta itemprop="dateModified" content="2015-08-09T15:13:36&#43;00:00" />
<meta itemprop="wordCount" content="213">



<meta itemprop="keywords" content="posts,posts-development,posts-email,posts-linux,projects,3d,3d-book,aws,blender,boot,case-sensitivity,cloudfront,command-lin,command-line,database,disk-image,email,gamedev,geodecoding,git,git-svn,hugo,javascript,jekyll,kernel,linux,ludum-dare,mac,mutt,mysql,quick-tip,s3,sql,static,sublime-text,svn,tips,unity,usb," />


<meta name="twitter:card" content="summary"/>


<meta itemprop="keywords" content="git,svn,git-svn," />

<meta name="twitter:text:title" content="Basic usage of git-svn"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Basic usage of git-svn"/>
<meta name="twitter:description" content="This is a small guide I wrote for my own convenience when I recently was converting an SVN repository to a Git repository. I&rsquo;ve published it here so that I can easily look up the things I need to remember..
I&rsquo;ve found most of these examples in the excellent official git-svn documentation.
@@ -85,10 +79,9 @@ Cloning the SVN repository git svn clone &lt;repo-url&gt; Adding another remote

<a class="cta" href="/index.xml">Subscribe</a>
</nav>


<section id="wrapper">
<article class="post">
<header>
@@ -118,22 +111,20 @@ Cloning the SVN repository git svn clone &lt;repo-url&gt; Adding another remote

<h2 id="cloning-the-svn-repository">Cloning the SVN repository</h2>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>git svn clone &lt;repo-url&gt;
</pre></div>

<pre><code class="language-shell">git svn clone &lt;repo-url&gt;
</code></pre>

<h2 id="adding-another-remote">Adding another remote</h2>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>git remote add &lt;remote-name&gt; &lt;remote-url&gt;
</pre></div>

<pre><code class="language-shell">git remote add &lt;remote-name&gt; &lt;remote-url&gt;
</code></pre>

<h2 id="fetching-and-rebasing-changes-from-svn">Fetching and rebasing changes from SVN</h2>

<p><div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>git svn fetch <span style="color: #f92672">&amp;&amp;</span> git svn rebase
</pre></div>
<pre><code class="language-shell">git svn fetch &amp;&amp; git svn rebase
</code></pre>

Note that the git-svn documentation has a section discussing rebase vs pull/merge:</p>
<p>Note that the git-svn documentation has a section discussing rebase vs pull/merge:</p>

<blockquote>
<p>Prefer to use git svn rebase or git rebase, rather than git pull or git merge to synchronize unintegrated commits with a git svn branch. Doing so will keep the history of unintegrated commits linear with respect to the upstream SVN repository and allow the use of the preferred git svn dcommit subcommand to push unintegrated commits back into SVN.</p>
@@ -141,29 +132,27 @@ Note that the git-svn documentation has a section discussing rebase vs pull/merg

<h2 id="doing-work-and-pushing-to-svn">Doing work and pushing to SVN</h2>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>git add &lt;file&gt;
git commit -m <span style="color: #e6db74">&quot;&lt;commit message&gt;&quot;</span>
git svn dcommit <span style="color: #75715e"># This will push your changes to the SVN repository</span>
</pre></div>

<pre><code class="language-shell">git add &lt;file&gt;
git commit -m &quot;&lt;commit message&gt;&quot;
git svn dcommit # This will push your changes to the SVN repository
</code></pre>

<h2 id="pushing-to-other-remotes">Pushing to other remotes</h2>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>git push &lt;remote-name&gt;
</pre></div>

<pre><code class="language-shell">git push &lt;remote-name&gt;
</code></pre>

<h2 id="see-what-will-be-pushed-to-svn">See what will be pushed to SVN</h2>

<p><div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>git diff git-svn HEAD <span style="color: #75715e"># Assuming your remote SVN branch is called git-svn</span>
</pre></div>
<pre><code class="language-shell">git diff git-svn HEAD # Assuming your remote SVN branch is called git-svn
</code></pre>

<a href="http://stackoverflow.com/a/9776318/1094451">http://stackoverflow.com/a/9776318/1094451</a></p>
<p><a href="http://stackoverflow.com/a/9776318/1094451">http://stackoverflow.com/a/9776318/1094451</a></p>

<p><div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span>git svn dcommit --dry-run
</pre></div>
<pre><code class="language-shell">git svn dcommit --dry-run
</code></pre>

<a href="http://stackoverflow.com/a/6040113/1094451">http://stackoverflow.com/a/6040113/1094451</a></p>
<p><a href="http://stackoverflow.com/a/6040113/1094451">http://stackoverflow.com/a/6040113/1094451</a></p>

</section>
</article>
@@ -198,6 +187,13 @@ git svn dcommit <span style="color: #75715e"># This will push your changes to th
<li>
<a href="/post/2018-02-09-ubuntu-sudo-nopasswd/">Disabling password for sudo in Ubuntu<aside class="dates">Feb 9</aside></a>
</li>
<li>
<a href="/post/2017-07-30-ludum-dare-39/">Ludum Dare 39: PowerClick<aside class="dates">Jul 30</aside></a>
</li>
@@ -259,13 +255,6 @@ git svn dcommit <span style="color: #75715e"># This will push your changes to th
</li>
<li>
<a href="/2015/08/09/basic-usage-of-git-svn/">Basic usage of git-svn<aside class="dates">Aug 9</aside></a>
</li>
</ul>

<footer id="footer">
@@ -294,17 +283,25 @@ git svn dcommit <span style="color: #75715e"># This will push your changes to th
<p class="small">
© Copyright 2017 Kim Grytøyr
© Copyright 2018 Kim Grytøyr
</p>
</footer>

</section>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/main.js"></script>
<script src="/js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/instantclick.min.js" data-no-instant></script>
<script>
InstantClick.on('change', function() {
setTimeout(function() {
hljs.initHighlighting();
}, 100);
});
</script>
<script data-no-instant>InstantClick.init();</script>




+ 30
- 29
public/2015/08/09/deleteing-rows-with-a-left-join-in-mysql/index.html View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Kim Grytøyr">
<meta name="description" content="Personal website for Kim Grytøyr.">
<meta name="generator" content="Hugo 0.20" />
<meta name="generator" content="Hugo 0.36" />
<title>Deleting rows with a LEFT JOIN in MySQL &middot; Kim Grytøyr</title>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
@@ -18,8 +18,6 @@

<link href="/index.xml" rel="alternate" type="application/rss+xml" title="Kim Grytøyr" />

<meta property="og:title" content="Deleting rows with a LEFT JOIN in MySQL" />
<meta property="og:description" content="This is something I don&rsquo;t do that often, and I always forget the correct syntax. Thus this post.
@@ -32,6 +30,7 @@ SELECT i.* FROM images i LEFT JOIN users u ON i." />


<meta property="article:published_time" content="2015-08-09T11:28:36&#43;00:00"/>

<meta property="article:modified_time" content="2015-08-09T11:28:36&#43;00:00"/>


@@ -53,20 +52,15 @@ First, I usually do a visual inspection of the rows that will be deleted:
SELECT i.* FROM images i LEFT JOIN users u ON i.">


<meta itemprop="datePublished" content="2015-08-09T11:28:36&#43;00:00" />
<meta itemprop="dateModified" content="2015-08-09T11:28:36&#43;00:00" />
<meta itemprop="wordCount" content="146">



<meta itemprop="keywords" content="posts,posts-development,posts-email,posts-linux,projects,3d,3d-book,aws,blender,boot,case-sensitivity,cloudfront,command-lin,command-line,database,disk-image,email,gamedev,geodecoding,git,git-svn,hugo,javascript,jekyll,kernel,linux,ludum-dare,mac,mutt,mysql,quick-tip,s3,sql,static,sublime-text,svn,tips,unity,usb," />


<meta name="twitter:card" content="summary"/>


<meta itemprop="keywords" content="mysql,sql,database,reference," />

<meta name="twitter:text:title" content="Deleting rows with a LEFT JOIN in MySQL"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Deleting rows with a LEFT JOIN in MySQL"/>
<meta name="twitter:description" content="This is something I don&rsquo;t do that often, and I always forget the correct syntax. Thus this post.
Let&rsquo;s say you have a table images and a table users. Now you want to delete all rows in table images that are associated with rows in the table users that are marked as deleted.
@@ -88,10 +82,9 @@ SELECT i.* FROM images i LEFT JOIN users u ON i."/>

<a class="cta" href="/index.xml">Subscribe</a>
</nav>


<section id="wrapper">
<article class="post">
<header>
@@ -108,6 +101,8 @@ SELECT i.* FROM images i LEFT JOIN users u ON i."/>
<a href="/tags/database">database</a>
<a href="/tags/reference">reference</a>
</h2>
@@ -119,15 +114,13 @@ SELECT i.* FROM images i LEFT JOIN users u ON i."/>

<p>First, I usually do a visual inspection of the rows that will be deleted:</p>

<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">SELECT</span> <span style="color: #f8f8f2">i.</span><span style="color: #f92672">*</span> <span style="color: #66d9ef">FROM</span> <span style="color: #f8f8f2">images</span> <span style="color: #f8f8f2">i</span> <span style="color: #66d9ef">LEFT</span> <span style="color: #66d9ef">JOIN</span> <span style="color: #f8f8f2">users</span> <span style="color: #f8f8f2">u</span> <span style="color: #66d9ef">ON</span> <span style="color: #f8f8f2">i.user_id</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">u.id</span> <span style="color: #66d9ef">WHERE</span> <span style="color: #f8f8f2">u.deleted</span> <span style="color: #f92672">=</span> <span style="color: #ae81ff">1</span><span style="color: #f8f8f2">;</span>
</pre></div>

<pre><code class="language-sql">SELECT i.* FROM images i LEFT JOIN users u ON i.user_id = u.id WHERE u.deleted = 1;
</code></pre>

<p>The rows returned by this query are the rows that will be deleted when you run the following query:</p>

<p><div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span></span><span style="color: #66d9ef">DELETE</span> <span style="color: #f8f8f2">i</span> <span style="color: #66d9ef">FROM</span> <span style="color: #f8f8f2">images</span> <span style="color: #f8f8f2">i</span> <span style="color: #66d9ef">LEFT</span> <span style="color: #66d9ef">JOIN</span> <span style="color: #f8f8f2">users</span> <span style="color: #f8f8f2">u</span> <span style="color: #66d9ef">ON</span> <span style="color: #f8f8f2">i.user_id</span> <span style="color: #f92672">=</span> <span style="color: #f8f8f2">u.id</span> <span style="color: #66d9ef">WHERE</span> <span style="color: #f8f8f2">u.deleted</span> <span style="color: #f92672">=</span> <span style="color: #ae81ff">1</span><span style="color: #f8f8f2">;</span>
</pre></div>
</p>
<pre><code class="language-sql">DELETE i FROM images i LEFT JOIN users u ON i.user_id = u.id WHERE u.deleted = 1;
</code></pre>

<p>They key part here is to specify which table you want to delete from. In this case it&rsquo;s the table <code>i</code>, which is the <code>images</code> table.</p>

@@ -164,6 +157,13 @@ SELECT i.* FROM images i LEFT JOIN users u ON i."/>
<li>
<a href="/post/2018-02-09-ubuntu-sudo-nopasswd/">Disabling password for sudo in Ubuntu<aside class="dates">Feb 9</aside></a>
</li>
<li>
<a href="/post/2017-07-30-ludum-dare-39/">Ludum Dare 39: PowerClick<aside class="dates">Jul 30</aside></a>
</li>
@@ -225,13 +225,6 @@ SELECT i.* FROM images i LEFT JOIN users u ON i."/>
</li>
<li>
<a href="/2015/08/09/basic-usage-of-git-svn/">Basic usage of git-svn<aside class="dates">Aug 9</aside></a>
</li>
</ul>

<footer id="footer">
@@ -260,17 +253,25 @@ SELECT i.* FROM images i LEFT JOIN users u ON i."/>
<p class="small">
© Copyright 2017 Kim Grytøyr
© Copyright 2018 Kim Grytøyr
</p>
</footer>

</section>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/main.js"></script>
<script src="/js/highlight.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/instantclick.min.js" data-no-instant></script>
<script>
InstantClick.on('change', function() {
setTimeout(function() {
hljs.initHighlighting();
}, 100);
});
</script>
<script data-no-instant>InstantClick.init();</script>




+ 26
- 25
public/2015/08/09/useful-git-tips/index.html View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Kim Grytøyr">
<meta name="description" content="Personal website for Kim Grytøyr.">
<meta name="generator" content="Hugo 0.20" />
<meta name="generator" content="Hugo 0.36" />
<title>Useful git tips &middot; Kim Grytøyr</title>
<link rel="shortcut icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
@@ -18,8 +18,6 @@

<link href="/index.xml" rel="alternate" type="application/rss+xml" title="Kim Grytøyr" />

<meta property="og:title" content="Useful git tips" />
<meta property="og:description" content="This is a collection of useful git commands, aliases, tips and tricks that I&rsquo;ve come across or been using. Feel free to contribute to this collection by adding a comment below.
@@ -30,6 +28,7 @@ Aliases for ignoring files To prevent changes in already-commited files from bei


<meta property="article:published_time" content="2015-08-09T17:03:00&#43;00:00"/>

<meta property="article:modified_time" content="2015-08-09T17:03:00&#43;00:00"/>


@@ -49,20 +48,15 @@ Aliases for ignoring files To prevent changes in already-commited files from bei
Aliases for ignoring files To prevent changes in already-commited files from being commited, you can update your index with the --assume-unchaged flag for the files that you don&rsquo;t want to commit. Here are a couple of useful aliases for dealing with this.">


<meta itemprop="datePublished" content="2015-08-09T17:03:00&#43;00:00" />
<meta itemprop="dateModified" content="2015-08-09T17:03:00&#43;00:00" />
<meta itemprop="wordCount" content="166">



<meta itemprop="keywords" content="posts,posts-development,posts-email,posts-linux,projects,3d,3d-book,aws,blender,boot,case-sensitivity,cloudfront,command-lin,command-line,database,disk-image,email,gamedev,geodecoding,git,git-svn,hugo,javascript,jekyll,kernel,linux,ludum-dare,mac,mutt,mysql,quick-tip,s3,sql,static,sublime-text,svn,tips,unity,usb," />


<meta name="twitter:card" content="summary"/>

<meta itemprop="keywords" content="git,tips," />


<meta name="twitter:text:title" content="Useful git tips"/>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Useful git tips"/>
<meta name="twitter:description" content="This is a collection of useful git commands, aliases, tips and tricks that I&rsquo;ve come across or been using. Feel free to contribute to this collection by adding a comment below.
Aliases for ignoring files To prevent changes in already-commited files from being commited, you can update your index with the --assume-unchaged flag for the files that you don&rsquo;t want to commit. Here are a couple of useful aliases for dealing with this."/>
@@ -82,10 +76,9 @@ Aliases for ignoring files To prevent changes in already-commited files from bei

<a class="cta" href="/index.xml">Subscribe</a>
</nav>


<section id="wrapper">
<article class="post">