Skip to content

Instantly share code, notes, and snippets.

View andreascarpello's full-sized avatar
🏠
Working from home

Andrea andreascarpello

🏠
Working from home
View GitHub Profile
body {
background-color: black;
}
img {
max-width: 100%;
height: auto;
}
.ta-c {
text-align: center;
}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@andreascarpello
andreascarpello / script.js
Created March 23, 2015 08:46
Dottify plugin, Add dotted pattern to div element
/**
* Add dotted pattern to div element
* usage: $('div').dottify();
*/
$.fn.dottify = function() {
var container = this.parent();
this.css('position', 'relative');
var dottedBG = $('<div/>', {
'class': 'dotted-bg',
});
[
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } },
{ "keys": ["ctrl+up"], "command": "scroll_lines", "args": {"amount": 1.0 } },
{ "keys": ["ctrl+down"], "command": "scroll_lines", "args": {"amount": -1.0 } },
{ "keys": ["ctrl+shift+l"], "command": "expand_selection", "args": {"to": "line"} },
{
"keys": ["ctrl+shift+r"], "command": "browser_refresh", "args": {
"auto_save": true,
"delay": 0.5,
@andreascarpello
andreascarpello / script.js
Created March 19, 2015 08:51
JQUERY CHECK FUNCTION EXIST
//http://stackoverflow.com/questions/20027715/jquery-check-function-exist
// TRUNCATE TEXT IF OVERFLOW
if (typeof $.fn.functionName != 'undefined' && $.isFunction($.fn.functionName)) {
$('element').functionName();
}
@andreascarpello
andreascarpello / index.html
Last active August 29, 2015 14:16
Facebook Comments Test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
<meta property="fb:admins" content=" [ USER_ID ] " />
<meta property="og:title" content="Facebook Comments Test">
<meta property="og:type" content="Article">
@andreascarpello
andreascarpello / demo.html
Last active August 29, 2015 14:16
SliderJS
<!DOCTYPE html>
<html>
<head>
<style>
body{
margin: 0;
padding: 0;
}
ul, li{
@andreascarpello
andreascarpello / script.js
Created March 2, 2015 10:55
YouTube Video Embedded via iframe Ignoring z-index and cover html elements Flash Object And Z-Index: How To Make Them Play Nicely Together YouTube video content covering CSS drop down menus in IE < 9
/**
* Flash videos issue on IE:
* http://stackoverflow.com/questions/9074365/youtube-video-embedded-via-iframe-ignoring-z-index
* http://stackoverflow.com/questions/7747133/youtube-video-content-covering-css-drop-down-menus-in-ie-9
*/
//Fix z-index youtube video embedding
$('iframe').each(function() {
var url = $(this).attr("src");
if ($(this).attr("src").indexOf("?") > 0) {
@andreascarpello
andreascarpello / wordpress_new_site.sql
Created March 1, 2015 22:57
Change Wordpress site url
UPDATE wp_posts SET post_content = REPLACE(post_content,'www.domain.com/wp-content/uploads','www.domain.com/images');
UPDATE wp_posts SET guid = REPLACE(guid,'www.domain.com/wp-content/uploads','www.domain.com/images');
@andreascarpello
andreascarpello / _mixins.scss
Last active January 18, 2018 18:48
SCSS mixins
@mixin horizontal-menu($conf) {
$orientation: map-get($conf, orientation);
li {
@if $orientation == 'horizontal' {
display: block;
} @else {