Skip to content

Instantly share code, notes, and snippets.

View ronanguilloux's full-sized avatar

Ronan Guilloux ronanguilloux

View GitHub Profile
@LeoBenoist
LeoBenoist / GoogleImageSearch.php
Last active April 3, 2020 05:39
Find Image on google
<?php
/*
* Inspired by https://github.com/damiankw/google.imagesearch
*/
class GoogleImageSearch
{
public function findImagesForQuery(string $query): array
{
$html = $this->queryGoogle($query);
$pattern = '/\bhttps?:\/\/\S+(?:jpg)\b/';
@mickaelandrieu
mickaelandrieu / upgrade_to_symfony3-lts.md
Last active May 21, 2024 03:39
Migration guide to Symfony 3 LTS

Let's migrate a Symfony 2.8 LTS application to Symfony 3 LTS

Handle deprecations

First of all, ensure you don't have any deprecated!

The Symfony documentation explains it well, but let's sum up:

  • install the phpunit bridge ($ composer require --dev symfony/phpunit-bridge)
  • also check all your pages using web profiler and be ensure there is no deprecation error handled
  • found errors and need help about how to fix it ? I did a sort of guide.
@ashander
ashander / unfavorite.js
Last active December 7, 2022 01:37
Delete all your favorites (unfavorite or unlike every tweet) on twitter.com (thx to @JamieMason and @b44rd for inspiring this)
// 1. Go to https://twitter.com/i/likes
// 2. Keep scrolling to the bottom repeatedly until all your favs are loaded.
// 3. Run this in your console (open in chrome by View > Developer > JavaScript Console)
// Notes: this may take a while if you have a lot of favs/likes
// you can only access your most recent ~2000 likes.
// inspired by https://gist.github.com/JamieMason/7580315
$('.ProfileTweet-actionButtonUndo').click()
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active September 23, 2023 09:38
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

@mickaelandrieu
mickaelandrieu / upgrade2.3-to-2.7.md
Last active May 21, 2024 03:39
Complete migration guide from Symfony 2.3 LTS to Symfony 2.7 LTS

From Symfony 2.3 to Symfony 2.7: the complete guide

Objectives

  • assume your code doesn't use any deprecated from versions below Symfony 2.3
  • update dependencies from 2.3 to 2.7
  • do not support "deprecated", be "Symfony3-ready"
  • list tasks component by component, bundle by bundle.
@L1fescape
L1fescape / hackingtime.java
Created May 29, 2015 06:21
Time hack code snippet from the movie Kung Fury
DateTime warp = new DateTime(12, 33.9, 15);
warp.accessDimension(4);
for (int i = 0; i < warp.getGoal(); i++) {
double v = Math.power(m*c, 2);
warp.hackTime();
warp.advance(i.toTimeInterval());
}
if (past.currentDate() == warp.currentDate()) {
System.out.println("Time Hacked successfully.");
}
@imjasonh
imjasonh / markdown.css
Last active May 24, 2024 22:56
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@nl5887
nl5887 / transfer.fish
Last active March 22, 2022 09:07
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active December 1, 2023 08:21
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@woecifaun
woecifaun / doctrine_schema_update
Last active August 29, 2015 14:06
Little helper for Symfony doctrine:schema:update
#! /bin/sh
output="$(php app/console doctrine:schema:update --dump-sql)";
echo $output;
case $output in
Nothing* ) return 0;;
esac