Skip to content

Instantly share code, notes, and snippets.

View krazylegz's full-sized avatar

Vikram Dighe krazylegz

  • Augment Risk
  • Lititz, PA
View GitHub Profile
@krazylegz
krazylegz / router.js
Last active March 31, 2017 03:27 — forked from Robdel12/controllers.application.js
Emberx-select test helper failure
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('scientists');
New:
class BaseNotifier
def initialize(attributes={})
@client_ip, @ec2_instance_id, @environment, @hl7_message,
@hl7_response, @queue_response, @stats, @title = %i(
client_ip ec2_instance_id environment hl7_message
hl7_response queue_response stats title
).map do |key|
attributes.fetch(key, '')
end
<?php
$term_list = '';
$terms = get_terms('product_cat', array( 'taxonomy' => 'product_cat', 'child_of' => 16, 'exclude_tree' => 15 ););
foreach ($terms as $term) {
$term_list .= '<li><a href="/shop/product-category/' . $term->slug . '/" title="' . sprintf(__('View all products filed under %s', 'my_localization_domain'), $term->name) . '">' . $term->name . '</a></li>';
}
echo $term_list;
?>
@krazylegz
krazylegz / gist:5015095
Last active December 14, 2015 02:39 — forked from nertim/gist:5014613
class AddSchedulingAppointmentStatuses < ActiveRecord::Migration
def change
create_table :appointment_status do |t|
t.string :code
t.string :description
t.timestamps
end
AppointmentStatus.create(:code => 'S', :description => 'Scheduled')
@krazylegz
krazylegz / gist:5014621
Last active December 14, 2015 02:38 — forked from nertim/gist:5014613
class AddSchedulingAppointmentStatuses < ActiveRecord::Migration
def change
create_table :schapptstatc do |t|
t.string :code
t.string :descrip
t.timestamps
end
AppointmentStatus.create(:code => 'S', :description => 'Scheduled')
AppointmentStatus.create(:code => 'I', :description => 'Checked In')
AppointmentStatus.create(:code => 'O', :description => 'At Resource')
<script type="text/javascript">
$(function () {
var eventDate = new Date(2013, 2-1, 1);
if (eventDate - (new Date()) <= 0) {
$('.countdown-<?php the_id(); ?>').countdown({until: eventDate});
}else{
$('.countdown-<?php the_id(); ?>').html('Married on ' + eventDate.getMonth() + '/' + eventDate.getDay() + '/' + eventDate.getFullYear())
}
});
</script>
[root@cramp ~]# irb
irb(main):001:0> @foo = Struct.new(:foo, :bar)
=> #<Class:0x2b40c83d5bb0>
irb(main):002:0> def create_structure(arr)
irb(main):003:1> f = @foo.new(arr[0], arr[1])
irb(main):004:1> puts f.foo
irb(main):005:1> end
=> nil
irb(main):006:0> create_structure(["foo", "bar"])
NameError: undefined local variable or method `foo' for main:Object
<script type="text/javascript">
$(function() {
noty({"text":"Hi!","layout":"top","type":"error","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":false,"closable":true,"closeOnSelfClick":true});
});
</script>
<?php
if (!$post->post_parent) {
$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
} else {
$p = end(get_post_ancestors($post->ID));
$children = wp_list_pages('title_li=&child_of='.$p.'&echo=0');
}
if ($children):
$parent_title = end(get_post_ancestors($post));
!!! 5
%html{:class => 'no-js', :lang => 'en'}
%head
-# To render a different stylesheet partial inside the head (i.e. for admin layout)
-# just copy _stylesheets.html.haml, and point to that partial instead.
= render "layouts/head", :stylesheet_partial => "layouts/stylesheets"
%body{ :class => "#{controller.controller_name}" }
#container
%header#header