Skip to content

Instantly share code, notes, and snippets.

@agnoster
agnoster / README.md
Last active July 29, 2024 09:17
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@laracasts
laracasts / ApiTester.php
Last active August 29, 2015 13:58
Example
<?php
use Faker\Factory as Faker;
abstract class ApiTester extends TestCase {
/**
* @var int
*/
protected $times = 1;
@jgoux
jgoux / app.js
Created April 15, 2014 14:53
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@jamesarosen
jamesarosen / ember-data-notes.md
Last active October 9, 2016 17:55
Ember-Data Relationships and Legacy APIs

This post is one in a series on converting a Backbone app to Ember. See also Ember-Data Notes.

Recently, our team has been trying to get Ember-Data to work with an API that does not conform to the json:api standard. The experience has been mostly good, but we've really struggled with the relationships. We have a Customer model that has many pastInvoices and a single monthToDateInvoice. The URL for past invoices is /billing/invoice?explicit_customer_id={{customerId}}; for month-to-date, it's /billing?no_list=true&explicit_customer_id={{customerId}}. The JSON that the API returns for a customer does not include any link to those URLs.

First Attempt: InvoiceAdapter

Our first attempt was to create an InvoiceAdapter that understood how to fetch invoices from those URLs:

// app/billing/invoices/adapter.js:
@developit
developit / example.js
Last active December 25, 2018 22:01
mongoose-resource
import mongooseResource from '../lib/mongoose-resource';
import Foo from '../models/foo'; // a mongoose Model
export default mongooseResource('foo', Foo);
# supervisor
#
# Author: Günter Grodotzki <gunter@grodotzki.co.za>
# Version: 2015-04-25
#
# - set param "SUPERVISE=enable" to activate
# - chmod +x supervise.sh
#
packages:
yum:
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@marty-wang
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active June 27, 2024 13:34
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@gorangajic
gorangajic / es6-spread-immutable-cheatsheet.md
Last active April 11, 2024 08:32
es6 spread immutable cheatsheet

update object

var state = {
    id: 1,
    points: 100,
    name: "Goran"
};

var newState = {
@maxhoffmann
maxhoffmann / Main.elm
Last active February 8, 2018 23:57
Token HTTP Authentication in Elm
import Html.App as Html
import Html exposing (..)
import Html.Events exposing (..)
import Task
import Http
import Json.Decode as Json exposing ((:=))
-- Model