Skip to content

Instantly share code, notes, and snippets.

View marcelodeandrade's full-sized avatar

Marcelo de Andrade marcelodeandrade

View GitHub Profile
import { Injectable } from "@angular/core";
import { Http, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Observable';
@Injectable()
export class CustomHttp {
constructor(public http: Http) {
When running any composer commands, sometimes you see the following error stack:
```
[ReflectionException]
Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist
[ErrorException]
@rosswd
rosswd / css.md
Last active March 29, 2018 17:23
Emmet Workflow

CSS Syntax for Emmet

m10

margin: 10px;

m1.5

@markmarkoh
markmarkoh / README.md
Last active June 10, 2018 08:51
Custom Map Data in Datamaps
@cebe
cebe / BaseController.php
Created October 25, 2014 19:41
Yii2 API Auth with username and password
<?php
/**
*
*
* @author Carsten Brandt <mail@cebe.cc>
*/
namespace api\components;
use common\models\ApiSystem;
@DinoChiesa
DinoChiesa / sql-1.asp
Created May 21, 2013 04:40
An example of a Classic ASP module implemented in JavaScript. This one reads from a SQL database, does content negotiation, returning a query result as Text, XML, JSON, or HTML.
<%@ language="Javascript" %>
<script language="javascript" runat="server" src='json2.js'></script>
<script language="javascript" runat="server" src='stringExtensions.js'></script>
<script language="javascript" runat="server" src='contentNego.js'></script>
<script language="javascript" runat="server">
(function() {
// In an ASP scenario, this fn gets "exported"
@Glutnix
Glutnix / .gitconfig
Last active July 23, 2020 23:07
Git Aliases
[core]
autocrlf = true
excludesfile = C:\\Users\\Brett\\Documents\\gitignore_global.txt
# Git Extensions built-in commit editor
#editor = \"C:/Program Files (x86)/GitExtensions/GitExtensions.exe\" fileeditor
# Use Visual Studio Code
editor = code -w
longpaths = true
@jamband
jamband / PostController.php
Created May 26, 2015 11:02
Yii 2: Ajax + Delete
<?php
class PostController extends Controller
{
// ...
public function actionDelete($id)
{
$this->findModel($id)->delete();
if (!Yii::$app->request->isAjax) {
return $this->redirect(['index']);
@ythecombinator
ythecombinator / add_disqus_hexo.md
Created May 27, 2015 23:59
Simple tip for adding "Disqus" comments for Hexo.

In the footer of your theme (something like footer.ejs) you should add Disqus script:

<% if (config.disqus_shortname){ %>
<script>
  var disqus_shortname = '<%= config.disqus_shortname %>';
  <% if (page.permalink){ %>
  var disqus_url = '<%= config.url +"/"+ page.path %>';
  <% } %>
 (function(){
@hujuice
hujuice / integration-manager-repository-hooks.md
Last active March 9, 2021 00:57
Integration manager repository Git hooks for a PHP project

Here are suggested hooks for integration manager repository, in a composer based PHP project.

The IM has all the developer hooks, more the prepare-commit-msg to intercept unwanted merges.