Skip to content

Instantly share code, notes, and snippets.

@megamos
megamos / index.html
Created September 1, 2021 14:15
Vue JS | Dynamic editable table ( with add, remove and editing row and cell )
<div id="chartpanel" class="row" data-equalizer>
<div class="column small-12 left_panel" >
<header data-equalizer-watch>
<i class="fa fa-bars menu_top_icon" aria-hidden="true"></i>
<div class="right_nav">
<i class="fa fa-heart" aria-hidden="true"></i>
<i class="fa fa-link" aria-hidden="true"></i>
<i class="fa fa-user-circle" aria-hidden="true"></i>
</div>
@megamos
megamos / cloudSettings
Last active August 14, 2020 07:08
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-14T07:08:28.738Z","extensionVersion":"v3.4.3"}
@megamos
megamos / Calc.cs
Created February 14, 2020 09:04
Problem: "double cur = double.Parse(current);" failar att parsa en sträng som när current = "1.5". Sure kan använda TryParse() och skapa exception. Allt annat funkar, men när jag bytte från att använda long till double, så började parsing faila.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Calculator
{
class Calc
{
@megamos
megamos / gist:e057659fc056f8eccf6c13a6404c3adb
Created November 22, 2019 21:11
WoW riding equip macro (Replace Riding gear and trinkets)
/equipslot [nomounted] 14 Carrot on a Stick
/equip [nomounted] Gnomish Rocket Boots
/equipslot [mounted] 14 Gyrofreeze Ice Reflector
/equip [mounted] Omnicast Boots
/use Swift White Mechanostrider
February 10 of YR2 We have found thieves from Whoop There it is (6:18) causing trouble within our lands!
February 10 of YR2 264 peasants were kidnapped!
February 11 of YR2 Meteors rain across the lands and kill 36 peasants!
February 12 of YR2 Meteors rain across the lands and kill 172 peasants, 3 soldiers and 44 Harpies!
February 12 of YR2 We have found thieves causing trouble within our lands. Unfortunately, we know not where they came from.
February 12 of YR2 We have found thieves causing trouble within our lands. Unfortunately, we know not where they came from.
February 12 of YR2 We have found thieves from Whoop There it is (6:18) causing trouble within our lands!
February 12 of YR2 We have found thieves causing trouble within our lands. Unfortunately, we know not where they came from.
February 12 of YR2 Our mages noticed a possible spell attempt by Calena Morgan (6:18) causing trouble on our lands!
February 12 of YR2 Meteors rain across our lands, and are not expected to stop for 8 days.
@megamos
megamos / .angular-cli.json
Created April 24, 2018 08:12
Showing basic sass set up for angular
#.... removed to show less
"prefix": "app",
"styles": [
"sass/styles.sass"
],
"scripts": [],
#.... removed to show less
In this file we only change the value of "styles" from "styles.sass" to "sass/styles.sass" because
we have created a sass folder and moved the styles.sass file in to it.
@megamos
megamos / file.c
Created April 6, 2018 12:34
Cannot compile a simple c file
/* file.c */
#include &lt;stdio.h;&gt
int main()
{
printf("Hello World!\n");
return 0;
}
#Output
@megamos
megamos / bash_arrays_and_loops.sh
Last active April 4, 2018 09:36
Looping array by using var from outer loop
#!/bin/bash
# Departments
departments="engineering sales is"
# Users in each department
engineering=( Lars Jenny Carl )
sales=( Nils Mark Hunny )
is=( Robert Lisa John )
@megamos
megamos / capybara cheat sheet
Created April 3, 2017 16:21 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@megamos
megamos / form.rb
Created April 18, 2016 23:50
Trying to pass a hash with array through strong parameters
- url_path = _old_virtual_path.include?("new") ? venue_practices_path : venue_practice_path(@practice.venue_id,@practice)
.form
= simple_form_for(@practice, url: url_path ) do |f|
= f.error_notification
.form-inputs
= f.input :name, label: "Namn"
.row
.col-sm-6.category
= f.input :category, label: "Kategori"
.col-sm-6.under_category