Skip to content

Instantly share code, notes, and snippets.

View serenaf's full-sized avatar
😅
Always learning

serena serenaf

😅
Always learning
View GitHub Profile
@serenaf
serenaf / application.controller.js
Last active October 26, 2017 16:51 — forked from kevinkucharczyk/application.controller.js
Contextual Popover Component
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@serenaf
serenaf / components.collapsible-panel-body.js
Created October 21, 2017 22:22
Contextual Components Part 1
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
stopPropagationAndLog(event) {
// This action has access to the DOM event and can call
// stopPropagation on it to prevent the event from bubbling.
event.stopPropagation();
this.get('log')(`clickAttribute w/ stopPropagation of ${this.get('parentName')}`);
}
@serenaf
serenaf / gist:8dd2ff9d7bb94445de45a32f06f461cd
Last active September 26, 2016 14:09
Opt in Acquire Lite Apps
opt_ins = []
App.find_each do |app|
if app.can_use_feature?(:welcome_message) && !app.can_use_feature?(:visitor_auto_messaging) && PermittedLanguage.where(app_id: app.id).count > 1
opt_ins << app.id
end
end
opt_ins
app = a 6
@serenaf
serenaf / 2015-01-17-twitter-fave-german
Created July 26, 2015 21:51
German Translation of CSS Animations
---
layout: post
bodyClass: shorter
title: Twitter's "fave" Animation
description: Erfahren Sie wie Twitters schicke, neue 'fav' Animation funktioniert, mit Hilfe der CSS steps() Zeitfunktion.
categories: [animation, tips, transition, steps]
customCSS: twitter_fave.css
imageURL: /assets/images/posts/steps/twitter_fave_rectangle.png
source: https://raw.githubusercontent.com/cssanimation/posts/master/2015-01-17-twitter-fave.md
home_image: /assets/images/posts/steps/home.png
@serenaf
serenaf / numbers.txt
Created May 17, 2015 20:43
TopN integer
955
991
625
76
881
105
570
533
518
180
@serenaf
serenaf / flatten_array.py
Created May 17, 2015 20:38
Flatten Array
def flatten_array( array, result ):
""" if the array is empty then return [] """
if not array:
return []
else:
for a in array:
""" if the current index is a number, take this number as part of the flattened result """
if(isinstance(a,int)):
result.append(a)
else:
country policy plan legislation expenditures psychatrists suizideRateM suizideRat F suizideRateTotal
Afghanistan 1 1 1 * 0.16 6.2 5.3 5.7
Albania 1 1 1 * 1.83 6.6 5.2 5.9
Algeria 1 1 1 7.37 1.55 2.3 1.5 1.9
Angola 0 1 0 * 0.02 20.7 7.3 13.8
Argentina 1 1 0 * * 17.2 4.1 10.3
Armenia 0 0 1 3.38 4.04 5 0.9 2.9
Australia 1 1 1 7.64 12.76 16.1 5.2 10.6
Austria 0 1 1 * 19.71 18.2 5.4 11.5
Azerbaijan 1 1 1 2.5 5.08 2.4 1 1.7
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Loading CSV Data with D3</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
</head>
<body>
<svg width="675" height="150">
@serenaf
serenaf / WHO Mental Health Data.csv
Last active August 29, 2015 14:17
WHO Mental Health Data Set
Country Policy Plan Legislation Expenditures in % Psychatrists Suizide Rate M Suizide Rate F Suizide Rate Total
Afghanistan 1 1 1 * 0.16 6.2 5.3 5.7
Albania 1 1 1 * 1.83 6.6 5.2 5.9
Algeria 1 1 1 7.37 1.55 2.3 1.5 1.9
Angola 0 1 0 * 0.02 20.7 7.3 13.8
Argentina 1 1 0 * * 17.2 4.1 10.3
Armenia 0 0 1 3.38 4.04 5 0.9 2.9
Australia 1 1 1 7.64 12.76 16.1 5.2 10.6
Austria 0 1 1 * 19.71 18.2 5.4 11.5
Azerbaijan 1 1 1 2.5 5.08 2.4 1 1.7