Skip to content

Instantly share code, notes, and snippets.

@irazasyed
irazasyed / Install Composer using MAMP's PHP.md
Last active August 6, 2024 16:43
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@brianloveswords
brianloveswords / git-obliterate
Last active September 3, 2024 14:10
git-obliterate: for removing sensitive files you may have committed from the entire history of the project.
#!/bin/bash
file=$1
test -z $file && echo "file required." 1>&2 && exit 1
git filter-branch -f --index-filter "git rm -r --cached $file --ignore-unmatch" --prune-empty --tag-name-filter cat -- --all
git ignore $file
git add .gitignore
git commit -m "Add $file to .gitignore"
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active November 18, 2024 11:51
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@valexa
valexa / gist:8621322
Created January 25, 2014 18:43
NSDraggingSession
- (void)mouseDown:(NSEvent*)event
{
//create a NSPasteboardItem
NSPasteboardItem *pbItem = [NSPasteboardItem new];
[pbItem setDataProvider:self forTypes:[NSArray arrayWithObjects:NSPasteboardTypeTIFF, nil]];
//create a new NSDraggingItem with our pasteboard item.
NSDraggingItem *dragItem = [[NSDraggingItem alloc] initWithPasteboardWriter:pbItem];
NSPoint dragPosition = [self convertPoint:[event locationInWindow] fromView:nil];
@evansims
evansims / example.html
Last active February 5, 2024 16:52
Embedding or sharing a image or photo uploaded to Google Drive.
<a href="https://drive.google.com/uc?export=view&id=XXX"><img src="https://drive.google.com/uc?export=view&id=XXX" style="width: 500px; max-width: 100%; height: auto" title="Click for the larger version." /></a>
@vluzrmos
vluzrmos / App_Http_VideoStream.php
Last active October 22, 2024 21:47
Laravel VideoStream.
<?php
namespace App\Http;
/**
* Description of VideoStream
*
* @author Rana
* @link https://gist.github.com/vluzrmos/d5682ad426525196d069
*/
@yanknudtskov
yanknudtskov / oop-functions.php
Created April 22, 2016 16:34
OOP Functions for WordPress functions.php
<?php
class Functions {
private $theme_name;
private $theme_version;
public function __construct( $theme_name, $theme_version ) {
$this->theme_name = $theme_name;
@abhishekbhardwaj
abhishekbhardwaj / php71.sh
Created January 15, 2017 03:00
Install PHP7.1 on OSX with Homebrew
brew update
brew upgrade
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install php71
## To use PHP7.1 on CLI, add this to .bash_profile

Creating services

This guide shows how to create services on the system.

Creation

  1. Create the service on app/Services, for example, create the file HistoryService.php
<?php
namespace App\Services;
@rudolfratusinski
rudolfratusinski / parallels_tools_ubuntu_new_kernel_fix.md
Last active November 23, 2022 20:01
Parallels Tools fix for Ubuntu 18.04 and other Linux distributions with Kernel version >= 4.15

Preparation

  • In open Ubuntu 18.04 machine click Parallels Actions -> "Install Parallels Tools"

  • A "Parallels Tools" CD will popup on your Ubuntu desktop.

  • Open it by double mouse click, copy all the content to a new, empty directory on a desktop, name it for e.g. "parallels_fixed"

  • Open terminal, change directory to parallels_fixed (cd ~/Desktop/parallels_fixed)

  • Make command line installer executable (chmod +x install)

  • Change directory to "installer" (cd installer)

  • Make few other scripts executable: chmod +x installer.* *.sh prl_*