Skip to content

Instantly share code, notes, and snippets.

View larssg's full-sized avatar

Lars G. Sehested larssg

View GitHub Profile
def analyze
subclasses = ApplicationRecord.subclasses.sort_by(&:name); nil
bar = ProgressBar.create(total: subclasses.length)
result = {
empty: [],
old: [],
columns: []
}
@larssg
larssg / designer.html
Created June 11, 2014 10:23
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">

Keybase proof

I hereby claim:

  • I am larssg on github.
  • I am larssg (https://keybase.io/larssg) on keybase.
  • I have a public key whose fingerprint is A81A 5A07 86F7 5BE3 ABC0 A8CC B7F6 5324 F6C3 CE18

To claim this, I am signing this object:

class MyTest
attr_accessor :test_var
def a
test_var = 'abe'
end
def b
self.test_var = 'hund'
end
Index: sites/all/modules/custom/mjm_utility/mjm_utility.module
===================================================================
--- sites/all/modules/custom/mjm_utility/mjm_utility.module (revision 6976)
+++ sites/all/modules/custom/mjm_utility/mjm_utility.module (working copy)
@@ -525,15 +525,15 @@
_gaq.push(['corp._setAllowHash',false]);
_gaq.push(['corp._setAllowAnchor',true]);
_gaq.push(['corp._setAllowLinker',true]);
-_gaq.push(['corp._trackPageview']);
set :application, "scorekeepr.dk"
set :repository, "git://github.com/larssg/score-keeper.git"
set :deploy_to, "/var/www/#{application}"
set :deploy_via, :remote_cache
set :scm, :git
set :use_sudo, false
@larssg
larssg / check.js
Created March 4, 2011 10:32
Check all checkboxes containing a specific string in the id.
$('input[type=checkbox]').each(function() { var b = $(this); if(b.attr('id').indexOf('edit-facts') > -1) { b.attr('checked','checked') } });
<?php
// $ID$
if ($content->module == 'nodequeue') :
$image_size = mjm_get_preset($content->css_class);
?>
<div class="pane<?php print ($content->css_class ? ' '.$content->css_class : ''); ?>">
<?php if ($content->subject) : ?>
<h2 class="pane-header"><?php echo $content->subject; ?></h2>
<?php endif; ?>
@larssg
larssg / boliga.js
Created October 27, 2010 09:48
boliga.js
var boliga = {
months: ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'],
mapping: {
'1002': '8000,8200,8210,8220,8230,8240',
'1026': '8860,8870,8900,8920,8930,8940,8960,8970,8981,8983,8990,9550',
'1384': '6990,7500,7540,7560,7570,7600,7800,7830',
'1430': '6940,6950,6971,6980',
'1408': '7600,7620,7650,7660,7673,7680',
'1454': '8800',
bmiTell :: (RealFloat a) => a -> a -> String
bmiTell weight height
| bmi <= 18.5 = "You're underweight, you emo, you!"
| bmi <= 25.0 = "You're supposedly normal. Pffft, I bet you're ugly!"
| bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
| otherwise = "You're a whale, congratulations!"
where
bmi = weight / height ^ 2