Skip to content

Instantly share code, notes, and snippets.

View pije76's full-sized avatar

panjianom pije76

View GitHub Profile
@pije76
pije76 / Preferences.sublime-settings
Created July 29, 2017 21:09 — forked from amiroff/Preferences.sublime-settings
My Sublime Text User Preferences File
{
"always_prompt_for_file_reload": false,
"auto_complete": false,
"auto_complete_commit_on_tab": true,
"auto_find_in_selection": false,
"caret_style": "phase",
"color_scheme": "Packages/User/Themes/Mac CLassic.tmTheme",
"copy_with_empty_selection": false,
"default_line_ending": "unix",
"diff_changes_to_buffer": true,
@pije76
pije76 / git_toturial
Created July 29, 2017 21:00 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "[email protected]" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://[email protected]/VT.git # clone远程仓库
@pije76
pije76 / gist:eff79746215c8e5f5e9eb5d4c1d75f7e
Created July 29, 2017 01:09 — forked from zgohr/gist:3399170
SVG vector data to PNG
brew upgrade
brew update
brew install cairo
brew install py2cairo
ln -s ~/Developer/lib/python2.7/site-packages/cairo ~/.virtualenvs/wpd/lib/python2.7/site-packages/cairo
# I needed to specify that my virtual environment uses python 2.7.3 because by default it used 2.7.2
# but brew compiled py2cairo with 2.7.3
mkvirtualenv --no-site-packages -p ~/Developer/bin/python wpd
@pije76
pije76 / infinte.scroll.paginator.html.twig
Created June 14, 2017 19:41 — forked from guilu/infinte.scroll.paginator.html.twig
infinte scroll knppaginatorbundle twig
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>infinite scroll</title>
</head>
<body>
{% block body %}
<!-- aqui pones el la plantilla que pinta los resultados de knppaginator -->
@pije76
pije76 / infinite-scroll.js
Created June 13, 2017 21:33 — forked from xocasdashdash/infinite-scroll.js
Simple infinite scrol with jQuery and a Symfony2 backend
is_processing = false;
last_page = false;
function addMoreElements() {
is_processing = true;
$.ajax({
type: "GET",
//FOS Routing
url: Routing.generate('route_name', {page: page}),
success: function(data) {
if (data.html.length > 0) {
@pije76
pije76 / ICS.php
Created June 5, 2017 21:55 — forked from jakebellacera/ICS.php
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* ICS.php
* =======
* Use this class to create an .ics file.
*
* Usage
* -----
* Basic usage - generate ics file contents (see below for available properties):
@pije76
pije76 / PostController.php
Created June 3, 2017 05:34 — forked from bhaktaraz/PostController.php
Symfony Event Listener to Increase Post View Count
<?php
/**
* Created by PhpStorm.
* User: bhaktaraz
* Date: 8/24/15
* Time: 9:51 AM
*/
namespace BRB\Bundle\PostBundle\Controller;
@pije76
pije76 / Magent_Product_Category_Query.sql
Created May 25, 2017 07:02 — forked from tegansnyder/Magent_Product_Category_Query.sql
Query to retrieve all product ids and the category they belong to in Magento.
SELECT `e`.entity_id, `at_category_id`.`category_id`
FROM `catalog_product_entity` AS `e`
LEFT JOIN `catalog_category_product` AS `at_category_id`
ON (at_category_id.`product_id`=e.entity_id)
@pije76
pije76 / gist:2147d0cc24020a6c555569b254a88f2b
Created May 24, 2017 20:26 — forked from sebsto/gist:9a958ff1c761b8c7c90d
Create IAM User and Attach a Policy using Boto and JSON
import json, boto
# Connect to IAM with boto
iam = boto.connect_iam(ACCESS_KEY, SECRET_KEY)
# Create user
user_response = iam.create_user('aws-user')
# Create Policy
policy = { 'Version' : '2012-10-17'}