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';

Keybase proof

I hereby claim:

  • I am Cosmicist on github.
  • I am cosmicist (https://keybase.io/cosmicist) on keybase.
  • I have a public key whose fingerprint is 253C 1968 6A34 0457 043E 86B1 28F2 3987 953D A25C

To claim this, I am signing this object:

@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) {
git branch newbranch
git reset --hard HEAD~3
git checkout newbranch
@Cosmicist
Cosmicist / gist:8459515
Created January 16, 2014 17:34
Log Laravel queries with bindings in place
<?php
Event::listen('illuminate.query', function($query, $bindings, $time, $name)
{
$data = compact('bindings', 'time', 'name');
// Format binding data for sql insertion
foreach ($bindings as $i => $binding)
{
if ($binding instanceof \DateTime)
/*
* 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;
@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 / index.html
Created March 5, 2013 04:11
Simple JavaScript string formatter with possibility for custom regex
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>String format</title>
</head>
<body>
<h2>Default</h2>
<p>
<pre>Replacing &lt;strong&gt;{foo}&lt;/strong&gt; and &lt;strong&gt;{bar}&lt;/strong&gt;</pre>
@Cosmicist
Cosmicist / gist:4532649
Created January 14, 2013 19:33
Symfony2 nginx server config
server {
listen 80;
server_name symfony2;
root /var/www/symfony2/web;
error_log /var/log/nginx/symfony2.error.log;
access_log /var/log/nginx/symfony2.access.log;
location / {
server {
listen 80;
server_name www.example.com;
root /var/www/vhosts/example.com/public/;
location /
{
index index.php index.html index.htm;
}