Skip to content

Instantly share code, notes, and snippets.

View onemoreahmad's full-sized avatar

Ahmad onemoreahmad

  • Riyadh, Saudi Arabia
View GitHub Profile
<?php
//
// delete-old-tweets.php - https://github.com/timdp
//
// -- Instructions --
// 1. Save this script somewhere as delete-old-tweets.php
// 2. Get your Twitter archive and extract it to the same folder
// 3. Clone https://github.com/themattharris/tmhOAuth to the same folder
// 4. Register an app at dev.twitter.com and enter its credentials below
@vitorbritto
vitorbritto / rm_mysql.md
Last active July 5, 2024 17:22
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@rap2hpoutre
rap2hpoutre / laravel-forge-deploy.sh
Last active March 28, 2024 15:45
Laravel Forge deploy script without downtime
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/deploy" ]; then
rm -R /home/forge/deploy
fi
if [ -d "/home/forge/backup" ]; then
rm -R /home/forge/backup
fi
@martinlindhe
martinlindhe / App.vue
Created December 10, 2015 23:03
vue.js example
<template>
<div>
<nav-bar></nav-bar>
<cookie-info></cookie-info>
<router-view></router-view>
<corporate-footer></corporate-footer>
</div>
@teepluss
teepluss / example.php
Last active May 7, 2019 15:54
Example CloudSearch
<?php
use Aws\CloudSearch\CloudSearchClient;
use Aws\CloudSearchDomain\CloudSearchDomainClient;
// http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-cloudsearchdomain.html
$client = CloudSearchDomainClient::factory(array(
//'endpoint' => 'https://doc-example-xxx.ap-southeast-1.cloudsearch.amazonaws.com',
'endpoint' => 'https://search-example-xxx.ap-southeast-1.cloudsearch.amazonaws.com',
@ishu3101
ishu3101 / sample-resume.json
Last active January 31, 2024 22:57
Sample Resume in JSON Resume Format
{
"basics": {
"name": "Your first and last name",
"label": "",
"picture": "",
"email": "Your email address",
"phone": "A phone number, with any formatting you like. E.g. (555) 555-5555.",
"degree": "",
"website": "Your website URL",
"summary": "A one-sentence to one-paragraph overview text. Do not include any line-breaks.",
@juukie
juukie / macro.php
Created November 7, 2017 08:02
Laravel social media url macro
<?php
URL::macro('social', function ($name, $replacement = '#') {
return array_get([
'facebook' => 'https://www.facebook.com/mypage/',
'instagram' => 'https://www.instagram.com/mypage/',
'pinterest' => 'https://nl.pinterest.com/mypage/',
], $name), $replacement);
});
@DZuz14
DZuz14 / file.php
Created June 22, 2018 01:40
Save Craft 3 Entry With PHP
<?php
$section = Craft::$app->sections->getSectionByHandle('journalArticles');
$entryTypes = $section->getEntryTypes();
$entryType = reset($entryTypes);
$entry = new Entry([
'sectionId' => $section->id,
'typeId' => $entryType->id,
'fieldLayoutId' => $entryType->fieldLayoutId,
@julienbourdeau
julienbourdeau / webpack.mix.js
Created April 20, 2020 06:43
Laravel Mix with multiple Tailwind config and PurgeCSS (separate Admin dashboard and Front app)
const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
const rootPath = Mix.paths.root.bind(Mix.paths);
const tailwindPlugins = function(configFile, paths) {
const pluginList = [tailwindcss(configFile)];
if (mix.inProduction()) {
pluginList.push(require('@fullhuman/postcss-purgecss')({