Skip to content

Instantly share code, notes, and snippets.

View aguilarcarlos's full-sized avatar
👋

David Aguilar aguilarcarlos

👋
View GitHub Profile
@aguilarcarlos
aguilarcarlos / app_self_update.php
Last active September 10, 2015 07:17 — forked from ilya-dev/app_self_update.php
Raw prototype of an application updater
<?php namespace Acme;
use Illuminate\Filesystem\Filesystem;
class Updater {
/**
* The Filesystem instance
*
* @var Illuminate\Filesystem\Filesystem

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
#############################################
# 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
@aguilarcarlos
aguilarcarlos / multiple_ssh_setting.md
Created May 26, 2016 21:49 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@aguilarcarlos
aguilarcarlos / cookies.js
Created August 14, 2017 20:12 — forked from CrocoDillon/cookies.js
Export your awesome module using AMD, CommonJS, Node.js or just as global.
/*
* Inspiration (well… copy pasting more or less) from:
* https://github.com/ScottHamper/Cookies/blob/0.3.1/src/cookies.js#L127-L140
*
* Thanks Scott!
*/
(function (global) {
'use strict';
var MyModule = function () {
@aguilarcarlos
aguilarcarlos / what-forces-layout.md
Created August 17, 2017 04:04 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@aguilarcarlos
aguilarcarlos / videos.txt
Created January 22, 2018 18:34
Public Videos
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerMeltdowns.mp4
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/Sintel.mp4
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/SubaruOutbackOnStreetAndDirt.mp4
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4
@aguilarcarlos
aguilarcarlos / videos.json
Last active June 3, 2018 11:57 — forked from jsturgis/gist:3b19447b304616f18657
Creative Commons Videos
{
"categories":[
{
"name":"Movies",
"videos":[
{
"description":"Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources":[
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
],
@aguilarcarlos
aguilarcarlos / TipsForGit.md
Last active May 20, 2020 17:52
Fixing untracked files

Some tips for Git to Save your Life 👍

Rest branch to spefic commit or last commit

Firstly you need select th commit desired or simply reset the HEAD in current branch, (can check if you are in current branch using git branch.

git reset HEAD^ --hard // Or git reset +[commit]^ --hard

After that we need to force push doing this way:

@aguilarcarlos
aguilarcarlos / LC_CTYPE.txt
Created November 12, 2021 21:41 — forked from thanksdanny/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8