Skip to content

Instantly share code, notes, and snippets.

View manojLondhe's full-sized avatar
💭
I may be slow to respond.

Manoj L manojLondhe

💭
I may be slow to respond.
  • Pune, India
  • 02:00 (UTC +05:30)
View GitHub Profile
@akash-gajjar
akash-gajjar / tldv.py
Last active May 24, 2024 14:33
Download videos from TLDV.io
from datetime import datetime
from os import system
import requests
import json
## Please install ffmpeg before running this script and make sure it's in your PATH
## brew install ffmpeg
## Please install requests before running this script
## pip3 install requests
@whoisryosuke
whoisryosuke / AttachJwtToken.php
Created July 27, 2018 08:42
Laravel - Testing - Base class to extend basic API tests
<?php
namespace Tests\Traits;
use KushyApi\User;
trait AttachJwtToken
{
/**
* @var User
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
@coolbung
coolbung / gist:40e04f71fa268cb154f3
Last active February 10, 2016 16:25
Upload files using Joomla JHttp
$path = realpath('/absolute/path/to/file.jpg');
$upload_path = new \CURLFile($path);
$url = 'http://example.com/upload';
//$post_data['foo'] = 'bar';
$post_data['file'] = $upload_path;
//$headers['user-id'] = 'imli';
$headers['Content-Type'] = 'multipart/form-data';
@neuro-sys
neuro-sys / fix.md
Last active April 14, 2018 19:35
How to Fix PhantomJS to work with GhostDriver

Copy paste the line below to your terminal:

https://gist.githubusercontent.com/neuro-sys/3bf00b6cf28a93e07e44/raw/e8976da93a55e5ef7c5e8dc99c00772fffb06f6c/replacestring.c
gcc replacestring.c -oreplacestring
./replacestring "$(strings /usr/bin/phantomjs | grep "platform: ghostdriver")" " " < /usr/bin/phantomjs > phantomjs && chmod a+x phantomjs
sudo cp phantomjs /usr/bin/phantomjs

Alright, there's a bug in a recent version of PhantomJS which renders it unable to run with GhostDriver. The error is like this:

@connor
connor / pre-commit.sh
Created January 11, 2012 22:14
Check your files against JSHint before committing
# WHAT IS THIS?
# This is a pre-commit hook that runs your js code against jshint before committing.
# If you ever want to make a commit without it running this, simply run:
# git commit -n
# INSTRUCTIONS:
# 1. Install jshint-runner: npm install -g jshint-runner
# 2. In your git project, rename .git/hooks/pre-commit.sample to .git/hooks/pre-commit
# 3. Create a .jshintrc file in ~/. This is simply an object with the options you want. See mine here: https://gist.github.com/1597131
# 4. Paste the code below line 14 in that ~/.jshintrc file