Skip to content

Instantly share code, notes, and snippets.

@nishantmodak
nishantmodak / nginx.conf.default
Last active October 13, 2025 07:46
Default Nginx Conf
#user nobody;
#Defines which Linux system user will own and run the Nginx server
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
//uses angular-bootstrap-datetimepicker: https://github.com/dalelotts/angular-bootstrap-datetimepicker
angular.module('mymodule')
.directive('myDateTimePicker', function ($ionicPopup) {
return {
restrict: 'E',
template: '<input class="my-date-time-picker" type="text" readonly="readonly" ng-model="formatted_datetime" ng-click="popup()" placeholder="{{placeholder}}">',
scope: {
'title': '@',
'dateModel': '=ngModel',
@laracasts
laracasts / ApiTester.php
Last active February 6, 2020 15:57
Incremental APISs: Refactoring Tests and Traits
<?php
use Faker\Factory as Faker;
abstract class ApiTester extends TestCase {
/**
* @var Faker
*/
protected $fake;
@dustinlarimer
dustinlarimer / README.md
Last active September 11, 2018 01:38
Keen IO Geo Coordinates in a Google Map
@aaronksaunders
aaronksaunders / Google-Map-Directive-in-Ionic.markdown
Last active August 29, 2015 13:57
A Pen by aaron k saunders.

Google Maps Directive in Ionic

trying to use two tabs with a leaflet directive in each one and as soon as the two maps are rendered in the page... everything seems to lock up.

// Example 1
mediator.name = 'Doug';
mediator.subscribe('nameChange', function(arg){
console.log(this.name);
this.name = arg;
console.log(this.name);
});
mediator.publish('nameChange', 'Jorn');
sinon / chai / mocha / js-tests
_____________________________________
#### chai
expect(subject).not.equal(expected)
.a('string')
.instanceof(Foo)
// The before save handler will pass information to the after save handler to disable the
// after save handler from creating a loop.
// It also prevents client side code from triggering the silent change, by using a different flag
// that the client should never see.
// It should only be visible in the data browser, won't be sent to a client in an undefined state.
Parse.Cloud.beforeSave('TestObject', function(request, response) {
handleComingFromTask(request.object);
response.success();
});
@esfand
esfand / nginxvarcore.md
Last active May 17, 2021 16:39
Nginx Variables

Embedded Variables

The ngx_http_core_module module supports embedded variables with names matching the Apache Server variables. First of all, these are variables representing client request header fields, such as $http_user_agent, $http_cookie, and so on. Also there are other variables:

  • $arg_name
    argument name in the request line
@benmj
benmj / geocoder-service.js
Created August 29, 2013 16:38
An AngularJS Service for intelligently geocoding addresses using Google's API. Makes use of localStorage (via the ngStorage package) to avoid unnecessary trips to the server. Queries Google's API synchronously to avoid `google.maps.GeocoderStatus.OVER_QUERY_LIMIT`
/*global angular: true, google: true, _ : true */
'use strict';
angular.module('geocoder', ['ngStorage']).factory('Geocoder', function ($localStorage, $q, $timeout) {
var locations = $localStorage.locations ? JSON.parse($localStorage.locations) : {};
var queue = [];
// Amount of time (in milliseconds) to pause between each trip to the