Skip to content

Instantly share code, notes, and snippets.

View electricg's full-sized avatar

Giulia Alfonsi electricg

View GitHub Profile
@electricg
electricg / README.md
Last active October 15, 2016 10:29
Links in Electricomics desktop reader

External links in the Electricomics Desktop Reader

A simple link <a href="http://google.com">simple</a> will open the page inside the reader. The only way to navigate back to the comic (and the reader) is by hitting the back key of the keyboard.
Same happens if target is set to _self like <a target="_self" href="http://google.com">Link</a>.

A link with target set to _parent like <a target="_parent" href="http://google.com">Link</a> will open the page inside the reader. As above, the only way to navigate back (to the reader, in this case) is by hitting the back key of the keyboard.

@electricg
electricg / readme.md
Created September 15, 2016 09:09
App is damaged and can't be opened. You should move it to the Trash.

The problem

OS X Mountain Lion (10.8) has a new security feature called Gatekeeper. Gatekeeper is enabled by default and prevents applications distributed outside of the Mac App Store from launching.

Launching such application results in the error: " is damaged and can't be opened. You should move it to the Trash."

The workaround

Open Gatekeeper settings located in "System Preferences > Security & Privacy" Set "Allow applications downloaded from:" to "Anywhere" and confirm by pressing "Allow From Anywhere"

@electricg
electricg / .zshrc
Last active October 11, 2022 18:54
My oh-my-zsh
source /Users/giulia/.bash_profile
source /Users/giulia/.bashrc
ZSH_DISABLE_COMPFIX=true
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/giulia/.oh-my-zsh"
@electricg
electricg / aglio-collapse.js
Created March 11, 2016 12:59
aglio show and hide all script
(function() {
var show = document.createElement('div');
show.innerHTML = 'show all';
show.setAttribute('onClick', "[].slice.call(document.querySelectorAll('.collapse-button:not(.show)>.open')).forEach(function(el){el.click()})");
var hide = document.createElement('div');
hide.innerHTML = 'hide all';
hide.setAttribute('onClick', "[].slice.call(document.querySelectorAll('.collapse-button.show>.close')).forEach(function(el){el.click()})");
var wrapper = document.createElement('div');
wrapper.style.position = 'fixed';
wrapper.style.top = '0';
@electricg
electricg / current-dir-in-iterm-tab-title.sh
Last active January 8, 2016 09:04 — forked from phette23/current-dir-in-iterm-tab-title.sh
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@electricg
electricg / index.html
Last active September 6, 2016 10:37 — forked from anonymous/index.html
Vertical center
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
body, html {
height: 100%;
margin: 0;
@electricg
electricg / index.html
Created April 13, 2015 06:52
Promises animations
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Animations promises</title>
<style>
p {
font-size: 10px;
margin: 0;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@electricg
electricg / readme.md
Last active August 29, 2015 14:14
What to include inside a web design
  • List all the colors used, for everything: fonts, backgrounds, borders, shadows, glows, everything.
  • List all the fonts used, and their font style (italic/normal) and weight (bold, semibold, thin, light, regular, superbold, etc) — this is because for every single one of them there is a font file for the user to download
  • List all the typography used — that means a list for each type of text, where you specify color, font family, font size, font style, font weight
  • Every single item (boxes, lines, circles, rounded corners, unicorns, rainbows) must be measurable just by clicking on it and copying the values from their property panel — there sould be no need to use a screen ruler
  • If something is clickable (like a link), there must be the design for its hover, focus, active states (in some rare occasions there could be a visited state, eg YouTube videos already watched)