Skip to content

Instantly share code, notes, and snippets.

View matinrco's full-sized avatar
🤔

Matin matinrco

🤔
View GitHub Profile
@matinrco
matinrco / meteor-alternate-windows-installation.md
Created March 29, 2018 20:14
Meteor alternate windows installation

On some network or machine setups Meteor's installer for Windows may fail. In such cases, follow these simple steps to install Meteor manually:

  1. Install 7-Zip or any other program that knows how to extract tar.gz files.
  2. Download the installation archive from : x86 : https://packages.meteor.com/bootstrap-link?arch=os.windows.x86_32 x64 : https://packages.meteor.com/bootstrap-link?arch=os.windows.x86_64
  3. In a command prompt, run echo %LocalAppData%\.meteor -- this is the directory in which Meteor should be installed.
  4. Extract the installation archive into the directory above.
  5. Add this directory to your PATH environment variable.
  6. You should now be able to open a new command prompt and run meteor. Some versions of Windows may require restarting your machine first.
@matinrco
matinrco / VMWare3DEnabler.md
Created March 10, 2018 14:28
Enable 3D HW acceleration on VMWare Workstation on Linux host

Enable 3D HW acceleration on VMWare Workstation on Linux host


Add mks.gl.allowBlacklistedDrivers = "TRUE" to ~/.vmware/preferences

That's it :)

@matinrco
matinrco / npm-global-without-sudo.md
Last active March 9, 2018 17:25
Install npm packages globally without sudo on macOS or Linux

Install npm packages globally without sudo on macOS or Linux

1. Create a directory for global packages
mkdir "${HOME}/.npm-packages"
2. Indicate to npm where to store globally installed packages. In your ~/.npmrc file add:
@matinrco
matinrco / MeteorRESTEndpoint.js
Created February 13, 2018 13:58
Create restful API in meteor
import Fiber from 'fibers';
import bodyParser from 'body-parser'
if (Meteor.isServer) {
WebApp.connectHandlers
.use(bodyParser.urlencoded())
.use(bodyParser.json())
.use('/getUserProfile', function(req, res, next) {
@media screen and (min-width: 1200px) {
}
@media screen and (min-width: 992px) and (max-width: 1199px) {
}
@media screen and (min-width: 768px) and (max-width: 991px) {
}
@media screen and (min-width: 576px) and (max-width: 767px) {
@matinrco
matinrco / ChainSSHByProxyCommandAndNetcat.md
Last active December 6, 2017 10:55
Chain ssh by ProxyCommand and Netcat

I have windows machine in corporate which has vpn connection to access multiple servers. But I want to acccess servers from my home computer.

So I installed openssh server from here on windows machine. Download OpenSSH-Win64.zip or OpenSSH-Win32.zip file . (version 0.0.24.0 tested)

Extract the package in C:\Program Files\OpenSSH . As the Administrator, install SSHD and ssh-agent services

powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1
@matinrco
matinrco / DisableSameOriginPolicyOnChrome.txt
Created December 3, 2017 12:21
Disable same origin policy on google chrome
Run chrome with these flags :
--disable-web-security --user-data-dir
* Windows
* In windows create google chrome shortcut somewhere & add these flags to the end of target field then relaunch it from this shortcut
* tested on chrome 62
* "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir
* Linux
* In linux it's Ez, just run it !
@matinrco
matinrco / preventDebouncing.js
Created October 27, 2017 19:50
Prevent click debouncing in react native
export function throttle(func, wait, ctx, immediate = true) {
let timeoutRefId;
let args;
let context;
let timestamp;
let result;
const later = () => {
const last = timestampNow() - timestamp;
@matinrco
matinrco / MongoWithRobo3t.sh
Created October 27, 2017 10:20
This script will run Robo 3T (robomongo) with MongoDB and then it will close MongoDB if you close robo 3t
#!/bin/zsh
#mongodb data directory - change this to your desired location - and check for write permissions
DIRECTORY=~/.local/share/mongodb
#create directories if not exist
mkdir -p "$DIRECTORY/data"
mkdir -p "$DIRECTORY/log"
#create empty log file if not exist
@matinrco
matinrco / DragAndDrop.js
Created October 9, 2017 10:14
use jQuery drag and drop
$('div.uploadBox').on({
'drop dragdrop':function(event){
event.preventDefault();
console.log('dropped');
},
'dragenter':function(event){
event.preventDefault();
console.log('drag enter')
},
'dragleave':function(event){