Skip to content

Instantly share code, notes, and snippets.

View a-metta's full-sized avatar
👋

Alessandro Metta a-metta

👋
View GitHub Profile
@a-metta
a-metta / SidebarController.cs
Created September 20, 2013 00:28
Simple event system to queue and process prioritized events.
using System;
using System.Collections;
using System.Collections.Generic;
public class SidebarController : MonoBehaviour {
private SidebarEventController.GenericSidebarEventArgs currEventProcessed;
private SidebarEventController.SidebarEventID currEventID;
//Determines whether or not a specific sidebar is in view and available to
@a-metta
a-metta / batchRemoteDelete
Created March 11, 2014 00:29
Delete remote branches containing a specific substring in the name
for fstring in $(git for-each-ref --format="%(refname:short)" refs/remotes/origin/f_qa\*); do j=`echo $fstring | cut -d / -f 2`;j=$j;echo $j; done
@a-metta
a-metta / Preferences.sublime-settings
Created August 18, 2015 18:48
Sublime Text 3 User Settings
{
"font_face": "Input Mono",
"font_size": 12,
"font_options": ["no_round"],
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"translate_tabs_to_spaces": true,
@a-metta
a-metta / codecampsnippets.js
Last active December 2, 2015 02:31
A collection of snippets from freecodecamp for reference
// This is to access the location from the browser.
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$("#data").html("latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude);
});
}
@a-metta
a-metta / Twitch TV helper.markdown
Created February 23, 2016 06:39
Twitch TV helper
@a-metta
a-metta / commit-msg
Created March 16, 2017 08:41
Git commit message hook
#!/bin/bash
files=$(git diff --cached --name-only | grep '\.jsx\?$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
failed=0
for file in ${files}; do
@a-metta
a-metta / Readme.md
Created March 30, 2017 21:08 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
@a-metta
a-metta / snippets.js
Last active February 20, 2018 22:23
Learn redux snippets #javascript
// This enables hot loading for reducers
if (module.hot) {
module.hot.accept('./reducers/', () => {
// using require because the import syntax is required to be declared
// at the top of the file
const nextRootReducer = rquire('./reducers/index').default;
store.replaceReducer(nextRootReducer);
})
}
@a-metta
a-metta / modules.txt
Last active April 14, 2017 23:31
List of modules
Form Modules
https://github.com/christianalfoni/formsy-react
https://alexkuz.github.io/react-input-enhancements/
http://gcanti.github.io/tcomb-form
https://github.com/andrewhathaway/winterfell
https://github.com/davidkpiano/react-redux-form
ES6
https://www.npmjs.com/package/babel