Skip to content

Instantly share code, notes, and snippets.

View jarnesjo's full-sized avatar

Nicklas Jarnesjö jarnesjo

View GitHub Profile
  1. Open terminal
  2. nano kill_sophos
  3. Copy text below, right-click on terminal window and select 'Paste':
#!/bin/bash
sudo rm -R /Library/Sophos\ Anti-Virus/
sudo rm -R /Library/Application\ Support/Sophos/
sudo rm -R /Library/Preferences/com.sophos.*
sudo rm /Library/LaunchDaemons/com.sophos.*
sudo rm /Library/LaunchAgents/com.sophos.*
@jarnesjo
jarnesjo / table_to_string.lua
Created May 21, 2018 08:08
Table to string in lua
function table_to_string(tbl)
local result = "{"
for k, v in pairs(tbl) do
-- Check the key type (ignore any numerical keys - assume its an array)
if type(k) == "string" then
result = result .. "[\"" .. k .. "\"]" .. "="
end
-- Check the value type
if type(v) == "table" then

Keybase proof

I hereby claim:

  • I am jarnesjo on github.
  • I am jarnesjo (https://keybase.io/jarnesjo) on keybase.
  • I have a public key ASChkqXA8A8gStI01AHpSndj3s8HtRBl9t0pvg6FLKbIBwo

To claim this, I am signing this object:

@jarnesjo
jarnesjo / wp-config.php
Created March 5, 2014 13:57
Change WordPress installation url in wp-config
define('WP_HOME', 'http://min.testinstallation.se');
define('WP_SITEURL', 'http://min.testinstallation.se');
@jarnesjo
jarnesjo / style.css
Created February 28, 2014 08:00
Vertical align middle
/* Internet Explorer 10 */
display:-ms-flexbox;
-ms-flex-pack:center;
-ms-flex-align:center;
/* Firefox */
display:-moz-box;
-moz-box-pack:center;
-moz-box-align:center;
@jarnesjo
jarnesjo / functions.php
Created February 13, 2014 13:19
Clean up WordPress header
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'start_post_rel_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'adjacent_posts_rel_link' );
remove_action( 'wp_head', 'wp_shortlink_wp_head' );
@jarnesjo
jarnesjo / category.php
Created February 10, 2014 12:11
Create pagination with numbers in WordPress
<?php
// Pagniation
global $wp_query;
$big = 999999999; // need an unlikely integer
echo '<nav id="pagination" class="col-sm-12">';
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '/page/%#%',
'end_size' => 0,