Skip to content

Instantly share code, notes, and snippets.

View ilearnbydoing's full-sized avatar

Durgesh Gupta ilearnbydoing

View GitHub Profile
@diorahman
diorahman / client.html
Created December 26, 2011 03:34
Ajax, call jQuery POST to node.js expressjs
<html>
<head>
<title>jsonp test</title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(function(){
$('#select_link').click(function(e){
e.preventDefault();
console.log('select_link clicked');
@tuananh
tuananh / archive.html
Created November 12, 2013 15:16
Group posts by month in Jekyll archive page
---
layout: default
title: Archive
---
<div class="post">
<h2>Archive</h2>
<ul>
{% for post in site.posts %}
{% unless post.next %}
@yanknudtskov
yanknudtskov / disallow-file-mods.php
Created January 4, 2014 13:15
Disallow File Mods Be careful using this, as it will disable the ability to update both core, plugins and themes in the Wordpress Admin. It's very helpful for security or locking a website into a static version.
define('DISALLOW_FILE_MODS', true);
@patrickhammond
patrickhammond / android_instructions.md
Last active June 6, 2024 05:19
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@idleberg
idleberg / Install-Mcrypt.md
Last active May 31, 2023 17:13
Install Mcrypt on macOS

Setup php-mcrypt on macOS (and versions of Mac OS X)

These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.

Install

Install Mcrypt using Homebrew and PECL (comes with PHP)

# PHP 7.3
@JJediny
JJediny / gist:a466eed62cee30ad45e2
Created October 5, 2015 20:42
Jekyll Liquid Cheatsheet

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
@roberto-butti
roberto-butti / send_json_post_auth_with_guzzle.php
Created February 22, 2016 11:35
Send a JSON in a POST, with HTTP Basic Auth (Guzzle Version)
<?php
$endpoint_url="your_url_here";
$string_json = "your_json_string";
$username="username";
$password ="password";
$client = new Client();
$options= array(
'auth' => [
$username,
@fourstacks
fourstacks / Taxonomy.php
Last active January 6, 2023 03:15
Pulling in Yoast SEO meta for terms using Corcel
<?php
// This model simply inherits from the base Corcel Taxonomy model.
// It allows us to set our DB connection and also implement the
// ImportsTermSeo trait (see next file)
namespace App\Models\Corcel;
use App\Wordpress\ImportsTermSeo;
@MustansirZia
MustansirZia / index.js
Last active May 17, 2020 10:20
Reverse Geocode JS [ES7] Gist - Latitude/Longitude to local address.
/**
* Created by M on 15/04/17. With ❤
*/
/*
* Reverse Geocode JS [ES7] Gist. Converts latitude/longitude to a human readable address.
* Firstly, tries to judge whether the lat/long is over a road. If so, returns the local street address
* with state and country stripped out.
* If not, returns the local address for the nearest point of interest. (or place). The second condition works even if
* the lat/long belongs to a disputed territory such as Kashmir, India.
@peterbrinck
peterbrinck / Laravel on VestaCP.md
Last active July 2, 2023 14:49
Laravel web templates for VestaCP

I'm not using this or VestaCP anymore, so I can't confirm if still working or not.

I've made a new web template to make Laravel work easily on VestaCP, and so I wouldn't have to change my Laravel installation, if I ever wanted to deploy it elsewhere.

Each file should be put in /usr/local/vesta/data/templates/web/apache2

Then, when you edit your domain/site, you can change the web template to Laravel and just upload your whole project into public_html