Skip to content

Instantly share code, notes, and snippets.

View negativo's full-sized avatar
:octocat:
:)

Davide Berardi negativo

:octocat:
:)
View GitHub Profile
@negativo
negativo / prepare-commit-msg.sh
Created April 25, 2018 15:04 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
// svg
<svg class="elephant">
<g transform="scale(3)">
<polygon id="Page-1" points="23.3328895 11.1580892 22.8418363 11.1580892 16.0917836 17.9081419 12.9359147 14.7522731 12.4448616 14.7522731 9.95540651 17.224721 9.95540651 17.7157742 15.8467128 23.60708 16.337766 23.60708 25.8053725 14.1394735 25.8053725 13.6484203"></polygon>
</g>
</svg>
// js
var polys = document.querySelectorAll('polygon,polyline');
[].forEach.call(polys,convertPolyToPath);
function evalBool(str){
if( str[0] === 't' &&
str[1] === 'r' &&
str[2] === 'u' &&
str[3] === 'e'
){
return true;
}
if( str[0] === 'f' &&
@negativo
negativo / permissions.txt
Created October 3, 2016 09:49 — forked from Arinerron/permissions.txt
A list of all Android permissions...
android.permission.REAL_GET_TASKS
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.REMOTE_AUDIO_PLAYBACK
android.permission.REGISTER_WINDOW_MANAGER_LISTENERS
android.permission.INTENT_FILTER_VERIFICATION_AGENT
android.permission.BIND_INCALL_SERVICE
android.permission.WRITE_SETTINGS
android.permission.CONTROL_KEYGUARD
android.permission.CONFIGURE_WIFI_DISPLAY
android.permission.ACCESS_WIMAX_STATE
@negativo
negativo / gist:547e3f8c05d55cfa706e4b8f38173c9d
Created September 30, 2016 14:59
Android Development on the Command Line
ANDROID CLI
1) Create Project
android create project \
--target 1 \
--name MyProjectName \
--path ./ProjectFolderPath \
--activity MyActivityName \
--package com.yourdomain.yourproject
@negativo
negativo / gist:152716565e4091eb9039f55f9781badd
Created September 27, 2016 16:52
send sms with aws provider in NODEJS
var AWS = require('aws-sdk');
AWS.config.region = 'your aws region';
AWS.config.update({
accessKeyId: "your access id",
secretAccessKey: "your secret access key",
});
var sns = new AWS.SNS();
var params = {
@negativo
negativo / gist:fe0ba9767c9adae601b4dbe1d7b40277
Last active September 20, 2016 18:41
Gruntfile with concurrent execution, concat, uglify, cssmin, coffee,less, htmlmin
module.exports = function(grunt){
grunt.initConfig({
coffee: {
compile: {
options: {
bare: true,
sourceMap:true
},
files: {
chrome.storage.sync.get(null, function(items) {
var allKeys = Object.keys(items);
console.log(allKeys);
});
(function () {
var i, elements = document.querySelectorAll('body *');
for (i = 0; i < elements.length; i++) {
if (getComputedStyle(elements[i]).position === 'fixed') {
elements[i].parentNode.removeChild(elements[i]);
}
}
})();
@negativo
negativo / lopmonhoc.js.jsx
Created March 11, 2016 10:52 — forked from revskill10/lopmonhoc.js.jsx
Integrate Datatable with React.js
/** @jsx React.DOM */
var LopMonHoc = React.createClass({
getInitialState: function(){
return {data: []}
},
loadData: function(){
$.ajax({
url: '/daotao/lops',
success: function(data){