Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jivagoalves on github.
  • I am jivagoalves (https://keybase.io/jivagoalves) on keybase.
  • I have a public key whose fingerprint is 34B8 DFFA 08A7 4C51 F514 0423 057F AE0A 6E4C 4418

To claim this, I am signing this object:

@jivagoalves
jivagoalves / maya.log
Created January 9, 2016 12:51
Maya Calendar on Ubuntu 15.10
$ env GSETTINGS_SCHEMA_DIR=$HOME/local/share/glib-2.0/schemas maya-calendar
[_LOG_LEVEL_INFO 12:09:15.571940] Application.vala:153: Maya version: 0.3.1.1
[_LOG_LEVEL_INFO 12:09:15.572054] Application.vala:155: Kernel version: 4.2.0-19-generic
[_LOG_LEVEL_FATAL 12:12:46.694963] maya_util_is_the_all_day: assertion 'dtend != NULL' failed
[_LOG_LEVEL_FATAL 12:12:46.695007] Maya will not function properly.
[_LOG_LEVEL_FATAL 12:12:46.695134] [GLib] g_date_time_format: assertion 'datetime != NULL' failed
[_LOG_LEVEL_FATAL 12:12:46.695177] Maya will not function properly.
Segmentation fault (core dumped)
@jivagoalves
jivagoalves / wc.rs
Created October 14, 2015 15:49
`wc -l` in Rust
use std::io;
use std::fs::File;
use std::io::prelude::*;
fn count(s: &str) -> io::Result<usize> {
let fd = try!(File::open(s));
let reader = io::BufReader::new(fd);
Ok(reader.lines().count())
}
/* ghosttest.c: GHOST vulnerability tester */
/* Credit: http://www.openwall.com/lists/oss-security/2015/01/27/9 */
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
# spec/db/seeds_spec.rb
require 'spec_helper'
describe "db:seed task" do
it "loads the seeds successfully" do
load "#{Rails.root}/db/seeds.rb"
end
end
require 'spec_helper'
describe "class visibility" do
class ClassDefinedAtDescribeLevel; end
it { class ClassDefinedAtItLevel; end }
end
puts "#{ClassDefinedAtDescribeLevel} defined"
# puts "#{ClassDefinedAtItLevel} defined" # raises error
namespace :db do
namespace :data do
task :check, [:padding] => [:environment] do |t, args|
# padding between columns
padding = (args[:padding] || 30).to_i
# load all models
Rails.application.eager_load!
# header
; http://aphyr.com/posts/305-clojure-from-the-ground-up-macros
; Problem 5
; Using the rationalize function, write a macro exact
; which rewrites any use of +, -, *, or / to force the
; use of ratios instead of floating-point numbers.
; (* 2452.45 100) returns 245244.99999999997, but
; (exact (* 2452.45 100)) should return 245245N .
(defmacro exact
[[f x y & more]]
(cond
# spec/db/seeds_spec.rb
require 'spec_helper'
describe "db:seed task" do
it "loads the seeds successfully" do
load "#{Rails.root}/db/seeds.rb"
end
end
#!/bin/bash
LIST=$(git log origin/production..master --no-merges --pretty=format:%s | egrep -o "[0-9]{6,}" | sort -u)
for id in $LIST; do
echo https://www.pivotaltracker.com/story/show/${id};
done