Skip to content

Instantly share code, notes, and snippets.

View marcortegaperez's full-sized avatar
🏠
Working from home

Marc Ortega Pérez marcortegaperez

🏠
Working from home
View GitHub Profile
@sandcastle
sandcastle / copy-to-clipboard.ts
Created July 17, 2017 06:38
A copy to clipboard function (in typescript)
export const copyToClipboard = (url: string) => {
document.addEventListener('copy', (e: ClipboardEvent) => {
e.clipboardData.setData('text/plain', url);
e.preventDefault();
document.removeEventListener('copy');
});
document.execCommand('copy');
};
@vahe-evoyan
vahe-evoyan / app.js
Created August 18, 2015 12:39
AngularJS Directive: UpperCase Input
var app = angular.module('InputDemo', []);
app.controller('MainController', [
// Dependencies
// Controller
function() {
// Does nothing
}
angular.module('ClientSuccess.services').factory 'fileService', (authService, $q, $rootScope)->
service = {}
service.uploadAvatar = (file) ->
deferred = $q.defer()
apiAuth = authService.enableAuth()
query =
binary: null
id: null
postIt = () ->
@johanmeiring
johanmeiring / gist:3002458
Created June 27, 2012 08:32
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@jelcaf
jelcaf / Operaciones-Git
Last active March 20, 2025 08:20
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas