Skip to content

Instantly share code, notes, and snippets.

View MicrowaveDev's full-sized avatar

Microwave Dev MicrowaveDev

View GitHub Profile
@technoweenie
technoweenie / gist:1072829
Created July 8, 2011 21:12
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@turboMaCk
turboMaCk / object.json.rabl
Created September 6, 2014 12:12
Rabl-Rails has_many relation render array of IDs
# object.json.rabl
# This is not regular rabl template
# This example is using rabl-rails gem: https://github.com/ccocchi/rabl-rails
object :@product
attributes :id, :name, :description
node :categories do |item|
item.categories.map do |category|
category.id
@mrexclamation
mrexclamation / NPerGroup.php
Last active December 19, 2017 14:07
Enhanced version of https://softonsofa.com/tweaking-eloquent-relations-how-to-get-n-related-models-per-parent/, tested on hasMany and belongsToMany relationships
<?php
namespace App\Traits;
trait NPerGroup {
/**
* query scope nPerGroup
*
* @return void
*/
pragma solidity >=0.4.22 <0.6.0;
// Reference implementation at
// https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC20/ERC20.sol
contract ERC20HighAssembly {
// uint256 private _totalSupply;
// mapping(address => uint256) private _balances;
constructor() public {