Skip to content

Instantly share code, notes, and snippets.

View eHammarstrom's full-sized avatar
🐚
script

Emil Hammarström eHammarstrom

🐚
script
  • Sweden
View GitHub Profile
import React, { Component } from 'react';
//import { ProviderTypes } from 'react-redux';
import './Post.css';
class Post extends Component {
constructor(props) {
super(props);
this.props = props;
}
Build failed, waiting for other jobs to finish...
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/initiumdoeslinux/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/initiumdoeslinux/git/opencv-rust/target/debug/deps/to_gray-0b025c97bdbd5265.0.o" "-o" "/home/initiumdoeslinux/git/opencv-rust/target/debug/deps/to_gray-0b025c97bdbd5265" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/home/initiumdoeslinux/git/opencv-rust/target/debug/deps" "-L" "/usr/lib" "-L" "/lib64" "-L" "/home/initiumdoeslinux/git/opencv-rust/target/debug/build/opencv-aa26f5c4e83bbd8b/out" "-L" "/home/initiumdoeslinux/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/initiumdoeslinux/git/opencv-rust/target/debug/deps/libopencv-f66beac4b5a79393.rlib" "/home/initiumdoeslinux/git/opencv-rust/target/debug/deps/liblibc-6451aa7d8103c93e.rlib"
@eHammarstrom
eHammarstrom / config
Created June 28, 2017 12:24
i3conf colors
set_from_resource $darkred color1 #000000
set_from_resource $red color9 #000000
set_from_resource $darkgreen color2 #000000
set_from_resource $green color10 #000000
set_from_resource $darkyellow color3 #000000
set_from_resource $yellow color11 #000000
set_from_resource $darkblue color4 #000000
set_from_resource $blue color12 #000000
set_from_resource $darkmagenta color5 #000000
set_from_resource $magenta color13 #000000
let NumStack = []
let expr = "15 7 1 1 + - / 3 * 2 1 1 + + -"
const applyOperator = (opr) =>
NumStack.push(opr(NumStack.pop(), NumStack.pop()))
let lastWasInt = false
let createInt = []
expr.split('').map((c) => {
#!/bin/python
import re
from collections import defaultdict
words = defaultdict()
txt = "Hej mitt namn är hej och hej kanske och hej"
split = re.findall(r'\w+', txt.lower())
@eHammarstrom
eHammarstrom / IntegerMonoids.hs
Last active September 16, 2017 09:47
Don't bind a specific Integer to a Monoid
import Data.Monoid
mappend (Product $ getSum $ mappend (Sum 3) (Sum 5)) (Product 2)
[ 3x^3
, 2x^2,
, -21x^2
, -14x
, 3x
, 2 ]
for (int i = 0; i < list_len; i++) {
for (int j = i; j < list_len; j++) {
import scala.collection._
val myList = List(1, 2, 3, 4, 5)
val myArray = Array(1, 2, 3, 4, 5)
def intersperse[T](xs: Traversable[T], in: T): Traversable[T] =
xs.flatMap(x => List(x, in))
println(intersperse(myList, 0))
println(intersperse(myArray, 0))
#include <stdio.h>
#include <stdlib.h>
#define LEN (10)
int main()
{
int (*a)[LEN] = calloc(LEN * LEN, sizeof(int*));
for (int i = 0; i < LEN; i++)
for (int j = 0; j < LEN; j++)
@eHammarstrom
eHammarstrom / sick_animals.hs
Last active January 23, 2018 16:13
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE ExistentialQuantification #-}
--
-- An animal that weighs < 5kg are deemed sick. Do we have any sick animals on our farm?
--
data Cow = Cow { weightC :: Integer, color :: String } deriving (Show)
data Sheep = Sheep { weightS :: Integer, fluffinessFactor :: Double } deriving (Show)
data Dog = Dog { weightD :: Integer, barks :: Bool } deriving (Show)