Skip to content

Instantly share code, notes, and snippets.

View Metrakit's full-sized avatar
🤘
Coding

Jordane Metrakit

🤘
Coding
View GitHub Profile
@Metrakit
Metrakit / Linns-Desk.markdown
Created February 23, 2015 12:10
Linn's Desk

Linn's Desk

This pen shows a orange coffee mug filled with coffee. Next to the mug is some spilled coffee. Inside the mug are animated ripples.

This could be used as a loader, but since that is not my intention—not sure about the original designer intentions—I have not implemented any relevant code for that purpose. If you do however want to use this as a loader, please have a look at one of my other loaders for accessibility features; e.g. correct markup.

Thanks

CSS rendition of “My Desk” by the talented Linn Fritz. Please visit her portfolio for more excellent work.

@Metrakit
Metrakit / gist:ac471806be94ad8343c4
Created April 25, 2015 11:41
Eager loading de la mort qui tue thanks to Laravel
<?php
// Master Model (Top.php)
class Top extends Eloquent {
public function topServer()
{
return $this->hasOne('TopServer');
}
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
@Metrakit
Metrakit / gist:de937634346771eebe76
Created May 30, 2015 11:10
#1336 - Dynamic SQL is not allowed in stored function or trigger
DELIMITER |
DROP TRIGGER IF EXISTS `vote_update` |
CREATE TRIGGER `vote_update`
AFTER INSERT ON `votes`
FOR EACH ROW
BEGIN
SET @row_day = CONCAT(DAYNAME(NOW()), '_votes');
@Metrakit
Metrakit / after.sh
Last active April 7, 2016 08:49
Install phpmyadmin on Laravel homestead
#!/bin/sh
# Content of the file 'after.sh' in ~/.homestead/
export DEBIAN_FRONTEND=noninteractive
apt-get --no-install-recommends install -q -y phpmyadmin
echo 'phpmyadmin phpmyadmin/dbconfig-install boolean true' | debconf-set-selections
echo 'phpmyadmin phpmyadmin/app-password-confirm password secret' | debconf-set-selections
echo 'phpmyadmin phpmyadmin/mysql/admin-pass password secret' | debconf-set-selections
# launch daemon nodejs app
nohup my-app &
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
/^\s*[a-zA-Z]{1}[a-zA-Z][a-zA-Z '-.=#\/]*$/
@Metrakit
Metrakit / gist:0c68e5563ae19e99f823
Created February 19, 2016 08:14
load css asynch
https://jakearchibald.com/2016/link-in-body/
<head>
<script>
// https://github.com/filamentgroup/loadCSS
!function(e){"use strict"
var n=function(n,t,o){function i(e){return f.body?e():void setTimeout(function(){i(e)})}var d,r,a,l,f=e.document,s=f.createElement("link"),u=o||"all"
return t?d=t:(r=(f.body||f.getElementsByTagName("head")[0]).childNodes,d=r[r.length-1]),a=f.styleSheets,s.rel="stylesheet",s.href=n,s.media="only x",i(function(){d.parentNode.insertBefore(s,t?d:d.nextSibling)}),l=function(e){for(var n=s.href,t=a.length;t--;)if(a[t].href===n)return e()
setTimeout(function(){l(e)})},s.addEventListener&&s.addEventListener("load",function(){this.media=u}),s.onloadcssdefined=l,l(function(){s.media!==u&&(s.media=u)}),s}
"undefined"!=typeof exports?exports.loadCSS=n:e.loadCSS=n}("undefined"!=typeof global?global:this)
@Metrakit
Metrakit / gist:ab62981d53fa3a62153b
Created March 2, 2016 09:35
Homestead versions
Homestead PHP 5.6 (version 0.3.3) :
vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.3.3/providers/virtualbox.box