Skip to content

Instantly share code, notes, and snippets.

View F1LT3R's full-sized avatar
🌱
Growing Things

Alistair MacDonald F1LT3R

🌱
Growing Things
View GitHub Profile
@F1LT3R
F1LT3R / styles.css
Last active July 5, 2020 10:12
Cloud9 IDE Styles
* {
font-family: SauceCodePro Nerd Font!important;
/*-webkit-font-smoothing : none!important;*/
}
.c9-menu-btn, .c9menu > .menu_item {
font-size: 15px;
padding-top: 6px;
-webkit-font-smoothing : none;
-webkit-font-smoothing : none!important;
@F1LT3R
F1LT3R / unicodeEscape.js
Created December 15, 2016 17:16 — forked from mathiasbynens/unicodeEscape.js
Escape all characters in a string using both Unicode and hexadecimal escape sequences
// Ever needed to escape '\n' as '\\n'? This function does that for any character,
// using hex and/or Unicode escape sequences (whichever are shortest).
// Demo: http://mothereff.in/js-escapes
function unicodeEscape(str) {
return str.replace(/[\s\S]/g, function(character) {
var escape = character.charCodeAt().toString(16),
longhand = escape.length > 2;
return '\\' + (longhand ? 'u' : 'x') + ('0000' + escape).slice(longhand ? -4 : -2);
});
}
@F1LT3R
F1LT3R / testing
Created July 3, 2016 17:12
testing
here
@F1LT3R
F1LT3R / progress-bar.sh
Created January 22, 2016 14:20
Bash Progress Bar
#!/bin/bash
# Bash Progress Bar: https://gist.github.com/F1LT3R/fa7f102b08a514f2c535
progressBarWidth=20
# Function to draw progress bar
progressBar () {
# Calculate number of fill/empty slots in the bar
@F1LT3R
F1LT3R / postgis.rb
Last active January 21, 2016 16:14
postgis.rb
# Modified from origin: https://raw.githubusercontent.com/Homebrew/homebrew/6063022e63b22b84547c64e4ab2d477f1459f9ee/Library/Formula/postgis.rb
class Postgis < Formula
desc "Adds support for geographic objects to PostgreSQL"
homepage "http://postgis.net"
url "http://download.osgeo.org/postgis/source/postgis-2.2.1.tar.gz"
sha256 "0fe500b0250203aac656bfa8f42f8458b63f33258404844e066e0e535988fa09"
bottle do
cellar :any
// Trying to get the controller's $scope
browser.executeScript(function () {
return angular.element(document.getElementById('app')).scope();
}).then(function($scope){
console.log($scope);
});
// Returns null for me even though my controller is running in #app element
@F1LT3R
F1LT3R / osx-font-smooth-anti-alias
Created October 9, 2015 14:13
OSX Font Smoothing Anti Aliasing
defaults -currentHost write -globalDomain AppleFontSmoothing -int 0
// ## $.withAdvice
//
// Borrowed by [Flight](https://github.com/flightjs/flight).
//
// `withAdvice` is a mixin that defines `before`, `after` and `around` methods.
//
// These can be used to modify existing functions by adding custom code. All
// components have advice mixed in to their prototype so that mixins can augment
// existing functions without requiring knowledge of the original
// implementation.
@F1LT3R
F1LT3R / something.js
Last active August 29, 2015 14:27
something.js
// In the app
app.factory('MyService', [function () {
return {
mydata: "Hello world!",
myfunc: function(a, b) {
return a+b;
}
}
}]);