Skip to content

Instantly share code, notes, and snippets.

Avatar
🤘
Hey, I Don't use GitHub. OK?

Chris Sederqvist cseder

🤘
Hey, I Don't use GitHub. OK?
View GitHub Profile
@cseder
cseder / flutter_error.txt
Created Nov 12, 2018
Get this error when running a flutter app to a physical iOS device
View flutter_error.txt
error: module importing failed: ('invalid syntax', ('temp.py', 1, 27, 'import fruitstrap_00008020-001839583A98002E\n'))
backtrace unavailable
View regex_test.rb
class String
def word_count
freq = Hash.new(0)
downcase.scan(/\w+/) { |word| freq[word] += 1 }
return freq
end
end
puts %{Dogs dogs dog dog dogs.}.word_count
View brainfreeze.rb
triangular_numbers = Enumerator.new do |yielder| number = 0
count = 1
loop do
number += count
count += 1
yielder.yield number
end
end
class Enumerator
@cseder
cseder / cpp11_string_iterator.cpp
Last active Dec 19, 2015
Looping through the chars in a std::string an converting them to uppercase "in-place" (same memory address). Using C++11 features.
View cpp11_string_iterator.cpp
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s("chris sederqvist");
if (s.begin() != s.end())