Skip to content

Instantly share code, notes, and snippets.

View yeomann's full-sized avatar
Hard work yields success

Danish yeomann

Hard work yields success
View GitHub Profile
@yeomann
yeomann / gist:a78513336a91a887b5600b4e16c82530
Last active March 4, 2019 16:29
Vscode unable to watch for file changes in large workspace - Ubuntu 18+
First we can check the current limits etc by following:
```
echo "MAX file watches allowed on system"
cat /proc/sys/fs/inotify/max_user_watches
echo "Current files in project - excluding node_modules"
find . -type f -not -path '**/node_modules/**' | wc -l
echo "Current files in project - including node_modules"
@yeomann
yeomann / React Native Simulators Command
Last active October 25, 2018 15:20 — forked from rexlow/md
Run React Native on specific iOS simulator version
To add a simulator
Choose Hardware > Device > Manage Devices.
Xcode opens the Devices window.
At the bottom of the left column, click the Add button (+).
In the dialog that appears, enter a name in the Simulator Name text field and choose the device from the Device Type pop-up menu.
//by default
@yeomann
yeomann / SQLite-PHP-quickstart.php
Created August 25, 2018 00:20 — forked from bladeSk/SQLite-PHP-quickstart.php
SQLite3 PHP Quickstart Tutorial
<?php
// This file walks you through the most common features of PHP's SQLite3 API.
// The code is runnable in its entirety and results in an `analytics.sqlite` file.
// Create a new database, if the file doesn't exist and open it for reading/writing.
// The extension of the file is arbitrary.
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
@yeomann
yeomann / evaldecode.php
Created August 15, 2018 19:48 — forked from yireo/evaldecode.php
Decode evil scripts encoded with eval(gzinflate(base64_decode()))
<?php
/*
* Basic script to decrypt files encoded with eval(gzinflate(base64_decode($data)));
*/
$file = 'encrypted.php';
$content = file_get_contents($file);
function evaldecode($content, $step = 0) {
//echo "STEP $step\n";
@yeomann
yeomann / eager-prefetching-async-data-example.js
Created August 6, 2018 10:50 — forked from bvaughn/eager-prefetching-async-data-example.js
Advanced example for eagerly prefetching async data in a React component.
// This is an advanced example! It is not intended for use in application code.
// Libraries like Relay may make use of this technique to save some time on low-end mobile devices.
// Most components should just initiate async requests in componentDidMount.
class ExampleComponent extends React.Component {
_hasUnmounted = false;
state = {
externalData: null,
};
@yeomann
yeomann / README.md
Created July 26, 2018 12:07 — forked from MoOx/README.md
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
@yeomann
yeomann / React Native Clear Cache
Last active July 4, 2018 19:45 — forked from jarretmoses/React Native Clear Cache
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean --force && npm install && npm start -- --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@yeomann
yeomann / .gitignore
Created January 30, 2018 19:56 — forked from christianchristensen/.gitignore
Simple PHP Graph data-structure.
/vendor
@yeomann
yeomann / autocomplete.php
Created June 14, 2017 12:26 — forked from imranismail/autocomplete.php
Laravel And JqueryUI's Autocomplete Plugin
//SearchController.php
public function autocomplete(){
$term = Input::get('term');
$results = array();
$queries = DB::table('users')
->where('first_name', 'LIKE', '%'.$term.'%')
->orWhere('last_name', 'LIKE', '%'.$term.'%')
->take(5)->get();