Skip to content

Instantly share code, notes, and snippets.

View hosseinm1997's full-sized avatar

Hossein Moshfegh hosseinm1997

View GitHub Profile
@eliashussary
eliashussary / metabase-postgres.docker-compose.yml
Created December 11, 2018 16:45
A docker-compose file for metabase with postgres.
version: "3"
services:
postgres-db:
image: postgres
restart: always
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: postgres
@stibiumz
stibiumz / CIDR.php
Last active April 30, 2024 14:23 — forked from jonavon/CIDR.php
<?php
/**
* CIDR.php
*
* Utility Functions for IPv4 ip addresses.
* Supports PHP 5.3+ (32 & 64 bit)
* @author Jonavon Wilcox <jowilcox@vt.edu>
* @revision Carlos Guimarães <cvsguimaraes@gmail.com>
* @version Wed Mar 12 13:00:00 EDT 2014
*/
@dbackeus
dbackeus / gist:2828125
Created May 29, 2012 12:21
Intercom cross domain error
XMLHttpRequest cannot load https://api.intercom.io/api/messages/index. Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin.
Failed to load resource: the server responded with a status of 422 (Unprocessable Entity) https://api.intercom.io/api/messages/index?app_id=wxtea8jc&email=admin%40streamio.se&user_id=4c57f3975412901427000003&user_hash=9b356512ca67ae94d038a7ea944d7d4ea42d6d0f&created_at=1338293917&custom_data=%7B%22account%22%3A%22ResqueMailerer%22%2C%22plan%22%3A%22test%22%2C%22url%22%3A%22http%3A%2F%2Flocalhost%3A3000%2Faccounts%2F4ec12b3b541290151d000004%2Fswitch%22%7D&name=Streamio%20Admin&inbox_installed=true&callback=IntercomJSONP1338293917981&_=1338293917981
@niieani
niieani / gist:1213709
Created September 13, 2011 12:33
PHP Camel Case functions
<?php
// source: http://www.paulferrett.com/2009/php-camel-case-functions/
/**
* Translates a camel case string into a string with underscores (e.g. firstName -&gt; first_name)
* @param string $str String in camel case format
* @return string $str Translated into underscore format
*/
function from_camel_case($str) {
$str[0] = strtolower($str[0]);