Skip to content

Instantly share code, notes, and snippets.

View ahmet's full-sized avatar
:shipit:
Shipping!

Ahmet Aygün ahmet

:shipit:
Shipping!
View GitHub Profile
@MuhammetDilmac
MuhammetDilmac / have_http_header.rb
Created February 13, 2020 17:35
RSpec Have HTTP Header Matcher
# frozen_string_literal: true
require 'rspec/expectations'
# Example Usage; expect(response).to have_http_header('Auth-Token')
RSpec::Matchers.define :have_http_header do |expected_header|
match do |response|
response.headers.keys.include? expected_header
end
1. hivemq.com/try-out
2. cloudmqtt.com
3. iot.eclipse.org
4. test.mosquitto.org
5. dev.rabbitmq.com
6. broker.mqttdashboard.com
7. q.m2m.io
8. mqtt.simpleml.com
9. mqtt.dioty.co
10. dioty.co
@olivierlacan
olivierlacan / migrate_postgresql_database.md
Last active March 24, 2022 20:30
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X. See upgraded version of this guide: http://olivierlacan.com/posts/migrating-homebrew-postgres-to-a-new-version/

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important:

@AttilaSATAN
AttilaSATAN / slugify.service.js
Last active October 22, 2018 14:39
Angularjs için türkçe slugify servisi.
angular.module('app.utils.services', []).
factory('slugify', function () {
return function(text){
if (!text) return null;
var trMap = {
'çÇ': 'c',
'ğĞ': 'g',
'şŞ': 's',
'üÜ': 'u',
'ıİ': 'i',
@maccman
maccman / jquery.ajax.queue.coffee
Last active January 13, 2018 12:03
Queueing jQuery Ajax requests. Usage $.ajax({queue: true})
$ = jQuery
queues = {}
running = false
queue = (name) ->
name = 'default' if name is true
queues[name] or= []
next = (name) ->
@maccman
maccman / jquery.onclose.coffee
Last active July 3, 2022 08:17
jQuery plugin to notify users if they close the page, and there are still some Ajax requests pending.
$ = jQuery
TRANSFORM_TYPES = ['PUT', 'POST', 'DELETE']
$.activeTransforms = 0
$(document).ajaxSend (e, xhr, settings) ->
return unless settings.type in TRANSFORM_TYPES
$.activeTransforms += 1
@muratcorlu
muratcorlu / slugify_tr.js
Created September 11, 2012 12:46
Javascript Türkçe karakter destekli slugify (url metni oluşturucu)
/**
* Metni url'de kullanılabilir hale çevirir. Boşluklar tireye çevrilir,
* alfanumerik olmayan katakterler silinir.
*
* Transform text into a URL path slug(with Turkish support).
* Spaces turned into dashes, remove non alnum
*
* @param string text
*/
slugify = function(text) {
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one