Skip to content

Instantly share code, notes, and snippets.

🙂
We'll get there

Brittan McGinnis konamax123

🙂
We'll get there
Block or report user

Report or block konamax123

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@konamax123
konamax123 / votes.js
Created Feb 3, 2014
This script goes through the votes object and it's nested object and counts the number of times that each candidate is voted for and then tallies them in a separate object. Then we need to somehow return a winner for each category.
View votes.js
/*
In this challenge you will work with the following JavaScript objects.
Do not alter these objects here.
*/
// I need to go through the votes object and look at each string which contains it's own object, then I need to go through
// each nested object and count how many times a canidites name comes up for each category in the votes count object and assign it
// to that object. We need to look at each property inside the nested objects and count how many times that value occurs.
View num_words.rb
def num_conversion(num)
singles = {0 => "zero", 1 => "one", 2 => "two", 3 => "three", 4 => "four", 5 => "five", 6 => "six",
7 => "seven", 8 => "eight", 9 => "nine" }
teens = {10 => "ten", 11 => "eleven", 12 => "twelve", 13 => "thirteen",
14 => "fourteen", 15 => "fifteen", 16 => "sixteen",
17 => "seventeen", 18 => "eighteen", 19 => "nineteen"}
tens = { 2 => "twenty", 3 => "thirty", 4 => "fourty", 5 => "fifty",
6 => "sixty", 7 => "seventy", 8 => "eighty", 9 => "ninety"}
@konamax123
konamax123 / gist:10605839
Created Apr 13, 2014
Difference between call() and apply()
View gist:10605839
View category
- @categories.each do |category|
%ul
%li= category.title
##nevermind here is the correct way to do it.
%ul
- @categories.each do |category|
%li= category.title
@konamax123
konamax123 / commentForm
Last active Aug 29, 2015
Trying to slidetoggle a comment form.
View commentForm
$(document).ready(function(){
CommentFormRevealer.bindEvents();
});
CommentFormRevealer = {
bindEvents: function(){
// console.log("I'm in bindEvents");
View contentSideBar.html.twig
<div class="sidebar-posts" xmlns="http://www.w3.org/1999/html">
<button class="dark-btn latest">Latest</button>
<button class="popular-posts active-btn">Most Popular</button>
<div class="shadowed">
<div class="post-scroll up"><div class="scroll-up-arrow"></div></div>
<ul class="gif-posts gif-sidebar">
{% for post in get_rail_posts('popular') %}
<li class="sidebar-popular">
<a href="{{ path('gif_site_post_view_by_slug', {slug: post.slug}) }}">
{{ resize_image(post, 98, 70, '', post.title, post.title) }}
@konamax123
konamax123 / gist:94ba50488efb9e418778
Last active Aug 29, 2015
Assigning a variable from ajax response
View gist:94ba50488efb9e418778
myObj = {
myAttr: function(){
$.ajax({
type: "GET",
url: myApi,
dataType: "jsonp",
success: function (data) {
return data
}
})
View gist:1b5ce7ba3f99fb7378ed
{% if random(1) == 1 %}
{% set sidebarQuery = "withSidebar" %}
{% include 'file.html.twig' %}
{% else %}
{% set sidebarQuery = "withoutSidebar" %}
{% endif %}
View gist:e6978c196396cc8d511b
==> default: Running provisioner: puppet...
==> default: Running Puppet with site.pp...
==> default: Notice: /Stage[main]//Node[default]/Exec[composer-install-dependencies]/returns: Loading composer repositories with package information
==> default: Notice: /Stage[main]//Node[default]/Exec[composer-install-dependencies]/returns: Installing dependencies (including require-dev) from lock file
==> default: Notice: /Stage[main]//Node[default]/Exec[composer-install-dependencies]/returns: - Installing zeeto/flux (dev-master f319731)
==> default: Notice: /Stage[main]//Node[default]/Exec[composer-install-dependencies]/returns: Cloning f319731a3c54bc3e31dad07c74dec02c8d7350be
==> default:
==> default: Notice: /Stage[main]//Node[default]/Exec[composer-install-dependencies]/returns:
==> default: Notice: /Stage[main]//Node[default]/Exec[composer-install-dependencies]/returns:
==> default: Notice: /Stage[main]//Node[default]/Exec[composer-install-dependencies]/returns:
@konamax123
konamax123 / object.js
Created Oct 7, 2015
object with some values as objects
View object.js
var obj = {
name: "Simon",
age: "20",
clothing: {
style: "simple",
isDouche: false
}
}
You can’t perform that action at this time.