Skip to content

Instantly share code, notes, and snippets.

View Haraldson's full-sized avatar

Hein Haraldson Berg Haraldson

View GitHub Profile
{
"id": "dagens",
"title": "Dagens",
"logo": "", // URL? Inside or outside configuration object?
"schedule": {
// Representation of what weekdays/time of day an issue should be published (as a guideline)
},
@Haraldson
Haraldson / hide-virtual-keyboard.js
Created March 5, 2014 10:41
Hide virtual keyboard on devices.
function hideVirtualKeyboard(os)
{
$('input, textarea').blur();
if(os === 'iOS')
document.activeElement.blur();
if(os === 'Android')
{
var $field = $('<input type="text">');

Fade in dynamically created elements using CSS3 animations

A simple proof of concept where CSS3 animations with animation-fill-mode: forwards is used to fade in elements created and added to DOM with JavaScript.

@Haraldson
Haraldson / appearance.json
Created January 23, 2014 10:33
Working draft for what an appearance configuration object should look like and contain
{
"palette": {
"colors": [
{
"label": "Økonomi",
"color": {
"primary": "#0000ff",
"secondary": "0000cc"
}
},
{
"caret_style": "phase",
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"detect_indentation": false,
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
"font_size": 12.0,
"highlight_line": true,
"ignored_packages":
[
@Haraldson
Haraldson / Gruntfile.js
Created November 20, 2013 13:07
grunt-contrib-require
module.exports = function(grunt)
{
grunt.initConfig(
{
pkg: grunt.file.readJSON('package.json'),
watch: {
css: {
files: ['www/assets/css/sass/**/*.scss'],
tasks: ['sass', 'autoprefixer', 'imageEmbed']
module.exports = function(grunt)
{
grunt.initConfig(
{
pkg: grunt.file.readJSON('package.json'),
watch: {
css: {
files: ['www/assets/css/sass/**/*.scss'],
tasks: ['sass', 'autoprefixer', 'imageEmbed']
@Haraldson
Haraldson / Gruntfile.js
Created October 25, 2013 09:13
Basic watch › sass
module.exports = function(grunt)
{
grunt.initConfig(
{
pkg: grunt.file.readJSON('package.json'),
watch: {
css: {
files: [
'www/assets/css/sass/*.scss',
// Sanitizing the data – it’s exactly the same coming from cache or from the API at the point where it’s set into the model
this.model
.set(data)
.trigger('change');
// In the initialize function
this.model.on('change', this.render, this); // this works
this.model.on('change', this.renderSubViews, this); // this does not even fire
define(
['marionette', 'model/publication', 'collection/issues', 'view/detail/publication', 'hbs!template/region/main-content'],
function(Marionette, PublicationModel, IssueCollection, PublicationCompositeView, MainContentRegionTemplate)
{
var MainContentRegionView = Marionette.ItemView.extend(
{
el: '#content',
// Use this template initially, with a spinner or something
template: MainContentRegionTemplate,