Skip to content

Instantly share code, notes, and snippets.

View ezy's full-sized avatar

Ezy ezy

  • Earth
View GitHub Profile
@ezy
ezy / block.tpl.php
Last active August 29, 2015 13:57
Drupal 7 cheatsheet
<!-- Print a template path -->
<?php print base_path(); ?>
/* ================================================================================ */
/* Columns and bootstrap componants for < 480px
/* ================================================================================ */
.col-ms-1, .col-ms-2, .col-ms-3, .col-ms-4, .col-ms-5, .col-ms-6, .col-ms-7, .col-ms-8, .col-ms-9, .col-ms-10, .col-ms-11, .col-ms-12 {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
@media (max-width: 480px) {
@ezy
ezy / gist:06b1c64fdac28c7c84c2
Created September 11, 2014 00:44
Angular-bootstrap CDN starter index.html
<!doctype html>
<html>
<head>
<title>Title</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap-theme.min.css" charset="utf-8">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap.min.css" charset="utf-8">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/fonts/glyphicons-halflings-regular.eot" charset="utf-8">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/fonts/glyphicons-halflings-regular.svg" charset="utf-8">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/fonts/glyphicons-halflings-regular.ttf" charset="utf-8">
@ezy
ezy / cipher.js
Created March 18, 2016 22:02
Caeser Cipher rough
function rot13(str) { // LBH QVQ VG!
var result = [],
rotdex = str.split(''),
charcode;
for (i = 0; i < rotdex.length; i++) {
charcode = (rotdex[i].charCodeAt() - 13);
if ((charcode + 13) == 32 || (charcode + 13) == 33 || (charcode + 13) == 46 || (charcode + 13) == 63) {
result.push(String.fromCharCode(charcode + 13));
}
@ezy
ezy / quickhttp.coffee
Last active March 20, 2016 05:01
Quick and dirty angular http controller get for a single result
# del ->
$scope.ext = []
$http.get('/data/social.json').then (result) ->
$scope.ext = result.data.fetchr[9]
console.log($scope.ext)
return
# -> del
@ezy
ezy / console.js
Last active September 2, 2016 00:34
Useful JS debug console commands
console.trace('trace var'); // get the trace and your great list of all related functions
eg.
this.funcY = function(){
this.funcZ();
}
this.funcZ = function(){
console.trace('trace car')
@ezy
ezy / Text overflow css.css
Created June 8, 2016 01:08
Automatically create dots with overflow text using CSS
.ind .table-container table td, .ind .table-container table th {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
@ezy
ezy / fizzbuzz.js
Last active June 24, 2016 21:23
Ezy's fizzbuzz (a.k.a pinocchio's Am I a real boy? test)
function fizzBuzz(n) {
var fizzy = [];
for (var i = 1; i <= n; i++) {
if (i % 3 === 0 && i % 5 === 0) {
fizzy.push("FizzBuzz");
}
else if (i % 3 === 0) {
fizzy.push("Fizz");
}
else if (i % 5 === 0) {
@ezy
ezy / gist:94858987d1ee6dfed0fd6eaffe10b9bd
Last active September 22, 2016 23:03
PHP Symfony commands
sudo rm -rf web/bundles/*
sudo rm -rf web/css/*
sudo rm -rf web/js/*
php app/console cache:clear
php app/console assets:install
php app/console assetic:dump
sudo rm -rf web/bundles/* ; sudo rm -rf web/css/* ; sudo rm -rf web/js/* ; sudo rm -rf var/logs/* ; sudo rm -rf /vagrant/var/cache/ ; php app/console assets:install ; php app/console assetic:dump
@ezy
ezy / dials.js
Last active July 25, 2016 02:52
D3js Gauges with data-attributes
'use strict';
var dials = document.getElementsByClassName('dial');
function Gauge(placeholderName, configuration) {
this.placeholderName = placeholderName;
var self = this; // for internal d3 functions
this.configure = function (configuration) {