Skip to content

Instantly share code, notes, and snippets.

@linuslundahl
linuslundahl / raycast-emoji-snippets.json
Created March 3, 2023 14:12
Raycast Emoji Snippets
[
{ "text": "0️⃣", "name": "0", "keyword": ":0:" },
{ "text": "1️⃣", "name": "1", "keyword": ":1:" },
{ "text": "🔟", "name": "10", "keyword": ":10:" },
{ "text": "💯", "name": "100", "keyword": ":100:" },
{ "text": "🥇", "name": "1st Place Medal", "keyword": ":1st-place-medal:" },
{ "text": "2️⃣", "name": "2", "keyword": ":2:" },
{ "text": "🥈", "name": "2nd Place Medal", "keyword": "2nd-place-medal:" },
{ "text": "3️⃣", "name": "3", "keyword": ":3:" },
{ "text": "🥉", "name": "3rd Place Medal", "keyword": ":3rd-place-medal:" },
@linuslundahl
linuslundahl / Ignore .DS_Store forever
Created September 13, 2010 09:55
Make git always ignore .DS_Store
$ git config --global core.excludesfile ~/.gitignore
$ echo .DS_Store >> ~/.gitignore
@linuslundahl
linuslundahl / jquery.el-in-view.js
Created December 10, 2011 11:20
jQuery Function that checks if an element is currently in the browser viewport.
function isScrolledIntoView(elem) {
var $win = $(window),
$elem = $(elem),
docViewTop = $win.scrollTop(),
docViewBottom = docViewTop + $win.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom) && (elemBottom <= docViewBottom) && (elemTop >= docViewTop));
}
@linuslundahl
linuslundahl / gist:02a6eccef5b998bd3baa
Last active August 17, 2019 06:40
MAMP with Brew

XAMP/MAMP stack with brew

For Brew driven MAMP with Apache2, PHP 5.3 and MySQL 5.x

Install brew (assuming that you have Xcode installed).

$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Install git and bash completion.

@linuslundahl
linuslundahl / remove-wp-attachment-thumbs.php
Created November 28, 2010 19:27
Remove generated attachment thumbnails from wordpress database.
global $wpdb;
$query = "SELECT meta_value, meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata'";
$result = $wpdb->get_results($query);
foreach ($result as $item) {
$meta = unserialize($item->meta_value);
unset($meta['sizes']);
$wpdb->update( 'wp_vira_postmeta', array('meta_value' => serialize($meta)), array('meta_id' => $item->meta_id) );
}

Keybase proof

I hereby claim:

  • I am linuslundahl on github.
  • I am linuslundahl (https://keybase.io/linuslundahl) on keybase.
  • I have a public key ASDTGwnjHSzQI3NyrUYxdlS2XZ9qaMl03noV-Pu2ChoT3go

To claim this, I am signing this object:

@linuslundahl
linuslundahl / dabblet.css
Created December 2, 2013 08:38 — forked from LeaVerou/dabblet.css
(C)Leanest CSS spinner ever
/**
* (C)Leanest CSS spinner ever
*/
@keyframes spin {
to { transform: rotate(1turn); }
}
.progress {
position: relative;
@linuslundahl
linuslundahl / _mixins.sass
Last active October 27, 2015 09:37 — forked from simme/_mixins.sass
SASS Mixins and Functions
// Rounds all the corners of a box
@mixin vector-bg-with-fallback($name) {
background-image: image-url('#{$name}.png');
background-image: none, image-url('#{$name}.svg');
}
@mixin border-radius($radius, $clip: padding-box)
-webkit-border-radius: $radius
-moz-border-radius: $radius
-o-border-radius: $radius
@linuslundahl
linuslundahl / drupal_table_pager.php
Created October 10, 2012 06:42 — forked from simme/drupal_table_pager.php
Drupal table with pager from db_select()
<?php
/**
* Display point award report.
*
* Generates a list of awarded points.
*
* @return array $content
*/
function game_report_page_points() {
@linuslundahl
linuslundahl / error_log
Created August 31, 2012 12:23
Send php error_log to OS X console.
$ mate /etc/php.ini
Add: error_log = /Users/USERNAME/Library/Logs/php.log
$ sudo chmod 755 ~/Library/ && sudo chmod 755 ~/Library/Logs && sudo touch ~/Library/Logs/php.log && sudo chmod 777 ~/Library/Logs/php.log