Skip to content

Instantly share code, notes, and snippets.

View antonellopasella's full-sized avatar
💯

Antonello Pasella antonellopasella

💯
View GitHub Profile
@antonellopasella
antonellopasella / Gruntfile.js
Last active December 14, 2015 09:28
How to setup LESS instead of SASS with yeoman 1.0 #yeoman #grunt #less
// Generated on 2013-03-01 using generator-webapp 0.1.5
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
@antonellopasella
antonellopasella / Applescript to send new iMessage
Last active February 20, 2019 19:09
How to send a new iMessage throug Applescript. For retrieve the contactname select your contact from list then SHIFT+CMD+I
tell application "Messages"
set isAppRunning to false
tell application "System Events"
if (exists process "Messages") then
set isAppRunning to true
end if
end tell
if isAppRunning is false then
@antonellopasella
antonellopasella / Vagrantfile
Created March 29, 2013 08:40
Howto setup a "non HDCP" network interface ousing Vagrant
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--memory", 256]
v.customize ["modifyvm", :id, "--nictype1", "virtio"]
v.customize ["modifyvm", :id, "--nictype2", "virtio"]
v.gui = true # for debug
end
@antonellopasella
antonellopasella / gist:5317373
Created April 5, 2013 07:46
Disable the creation of .DS_store files on network drives #osx #tip #defaults #write
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
To revert
defaults delete com.apple.desktopservices DSDontWriteNetworkStores
@antonellopasella
antonellopasella / gist:5411649
Created April 18, 2013 10:11
Implementing your own cache in AngularJs
Implementing your own cache in AngularJs is quite easy.
Just use $cacheFactory:
app.factory('myService', function($resource, $cacheFactory) {
var cache = $cacheFactory('myService');
var User = $resource('/user/:userId', {userId:'@id'});
return {
getResource: function(userId) {
var user = cache.get(userId);
var SCHEDULE = {
"events": [
{
"eventId": "9d831af2-60db-4dfa-86cf-5b10a130aadd",
"channelId": "CH-1",
"groupId": "GR-1",
"start": "2016-04-18T00:01:00.000Z",
"title": "Sleek Steel Cheese",
"end": "2016-04-18T00:42:00.000Z"
},
var Nightmare = require('nightmare');
var nightmare = Nightmare({
show: true,
openDevTools: true,
'webPreferences': {
'webSecurity': false
}
});
<meta http-equiv="Content-Security-Policy" content="default-src * data: * gap: https://ssl.gstatic.com 'unsafe-eval'; style-src * 'unsafe-inline'; media-src *; img-src *">
{
"name": "3x1010-italo-nightmare",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "UNLICENSED",