Skip to content

Instantly share code, notes, and snippets.

View teknotica's full-sized avatar
✌️

Silvia Rebelo teknotica

✌️
View GitHub Profile
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active May 6, 2024 14:31
Vanilla JavaScript Quick Reference / Cheatsheet
@roine
roine / controllerSpec.js
Last active May 18, 2016 10:49
Some notes on testing AngularJs with Jasmine and Karma.
describe('controllerCtrl', function () {
var $controller,
$rootScope,
$scope;
beforeEach(module('controller'));
beforeEach(inject(function ($injector) {
$controller = $injector.get('$controller');
$rootScope = $injector.get('$rootScope');
@intellix
intellix / perspective-back.js
Last active November 25, 2017 11:44
Moving a background and having foreground sit on top in AngularJS
'use strict';
angular.module('myApp').directive('perspectiveBack', function($window) {
return {
link: function(scope, element, attrs) {
var distance = attrs.distance || 2;
element.css({
'background-image': 'url(' + attrs.foreground +'), url(' + attrs.background + ')',
@asimpson
asimpson / bash_function
Created October 31, 2012 18:51
This little script sets up a custom domain in MAMP and your hosts file.
function vhost {
sudo ~/.dotfiles/osx/mamp_vh.sh $1
}
@brianmcallister
brianmcallister / maintain-ratio.scss
Last active December 9, 2022 20:18
Sass mixin for a responsive box that maintains an aspect ratio.
// Maintain ratio mixin. Great for responsive grids, or videos.
// https://gist.github.com/brianmcallister/2932463
//
// $ratio - Ratio the element needs to maintain.
//
// Examples
//
// // A 16:9 ratio would look like this:
// .element {
// @include maintain-ratio(16 9);
@ocean90
ocean90 / box-shadow.html
Last active April 11, 2024 13:54
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;