Skip to content

Instantly share code, notes, and snippets.

View Gujarats's full-sized avatar
💭
Reviewer

Gujarat Santana Gujarats

💭
Reviewer
View GitHub Profile
@border
border / mgoExample.go
Created August 27, 2012 15:33
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@nelstrom
nelstrom / getting-vim-with-clipboard-support.md
Created November 14, 2013 23:04
Original draft of [Getting Vim with `+clipboard` support](http://vimcasts.org/blog/2013/11/getting-vim-with-clipboard-support/). Shows what I know!

On OS X

On OS X Mavericks, Apple ships Vim version 7.3 with -clipboard. Here's the gist from running [/usr/bin/vim --version on Mavericks][10.9] (and [the same on Mountain Lion][10.8]). Shame on you Apple!

If you [use Homebrew][brew.sh], you can get Vim with +clipboard by running:

brew install vim

Here's a gist from running [/usr/local/bin/vim --version][brew].

@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active July 2, 2024 00:02
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@enis-ismail
enis-ismail / gist:9206023
Last active July 18, 2017 07:55
Magento: Get all configurable products' children from a category
<?php
require_once 'app/Mage.php';
Mage::app();
$categoryId = 86;
$products = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('type_id', 'configurable')
->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active July 3, 2024 02:22
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@eduncan911
eduncan911 / main.go
Created July 27, 2014 00:27
Go/Reading Console Inputs
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func main() {
@tdegrunt
tdegrunt / walk.go
Created September 29, 2014 11:53
Replace some text in a bunch of files with golang
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
package main
import (
"io/ioutil"
"log"
"strings"
)
func main() {
input, err := ioutil.ReadFile("myfile")
@m1st0
m1st0 / php_build_ubuntu.sh
Last active November 25, 2023 07:33
Compiling PHP 8 on Ubuntu 22.10 with Various Supported Modules
#!/bin/bash
# PHP 8 Compile #
# Author: Maulik Mistry
# Please share support: https://www.paypal.com/paypalme/m1st0
# References:
# http://www.zimuel.it/install-php-7/
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu
# root-talis https://gist.github.com/root-talis/40c4936bf0287237839ccd3fdfdaec28
#