Skip to content

Instantly share code, notes, and snippets.

View Cosmicist's full-sized avatar
🏴

Luciano Longo Cosmicist

🏴
  • Buenos Aires, Argentina
View GitHub Profile
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
@Cosmicist
Cosmicist / gist:834f03acf52566690950
Created December 18, 2015 14:54 — forked from robotslave/gist:4633393
How to get Emoji in your Ubuntu Terminal
<!--
1. Download the Android Jelly Bean fonts and the Symbola font:
https://www.dropbox.com/s/tvtzcnzkvbe0nrt/jelly-bean-fonts.zip
http://users.teilar.gr/~g1951d/Symbola707.zip
2. unzip the files and put AndroidEmoji.ttf and Symbola.ttf (and any of the other fonts that strike your fancy)
in your ~/.fonts/ directory
3. run `fc-cache -f`. You can check to make sure the new fonts
were installed with `fc-list`. You'll probably want to grep the copious output for Symbola or Emoji
@Cosmicist
Cosmicist / Git branch bash autocomplete *with aliases*
Created November 30, 2015 19:06 — forked from JuggoPop/Git branch bash autocomplete *with aliases*
Git branch bash autocomplete *with aliases* (add to .bash_profile)
# To Setup:
# 1) Save the .git-completion.bash file found here:
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect:
# Git branch bash completion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
# Add git completion to aliases
@Cosmicist
Cosmicist / scroller.js
Last active September 9, 2017 16:36 — forked from dezinezync/scroll.easing.js
Vanilla Javascript Scrolling function for easing based scrolling
var Scroller = function(anchors, config)
{
var cfg = compile({
duration: 1000,
offset: 0,
easing: Scroller.easing.inOutQuad,
callback: function() {}
}, config);
[].forEach.call(anchors, function(anchor) {
@Cosmicist
Cosmicist / specification.tpl
Last active September 4, 2015 16:12 — forked from greydnls/specification.tpl
PHPSpec Laravel template php5
<?php
namespace %namespace%;
use PhpSpec\Laravel\LaravelObjectBehavior as ObjectBehavior
use Prophecy\Argument;
class %name% extends ObjectBehavior
{
function it_is_initializable()
@Cosmicist
Cosmicist / uri.js
Created May 20, 2014 02:35 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@Cosmicist
Cosmicist / vhost.py
Last active August 29, 2015 14:00 — forked from fideloper/vhost.py
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#
/*
* Adapted from: http://code.google.com/p/gaequery/source/browse/trunk/src/static/scripts/jquery.autogrow-textarea.js
* Updated from: https://gist.github.com/thomseddon/4703968
*
* Works nicely with the following styles:
* textarea {
* resize: none;
* transition: 0.05s;
* -moz-transition: 0.05s;
* -webkit-transition: 0.05s;
server {
listen 80;
server_name www.example.com;
root /var/www/vhosts/example.com/public/;
location /
{
index index.php index.html index.htm;
}
@Cosmicist
Cosmicist / gist:3860074
Created October 9, 2012 17:05 — forked from wrboyce/gist:786460
pre-commit hook to automatically minify javascript/css
#!/bin/bash
# Search YUI Compressor anywhere in your home dir
echo "Searching for YUI Compressor..."
YUIC=`find ~/. -type f -name yuicompressor\*.jar`
if ! [ $YUIC ]
then
echo "Unable to find YUI Compressor! Goodbye!"
exit
fi