Skip to content

Instantly share code, notes, and snippets.

View bhargavjoshi's full-sized avatar

Bhargav Joshi bhargavjoshi

View GitHub Profile
@avataru
avataru / EloquentCheatSheet.md
Last active April 5, 2024 20:39
Eloquent relationships cheat sheet
@milkersarac
milkersarac / scriptAndroid.sh
Last active June 24, 2020 19:14
This script can be used for building multiple react-native apps from a single git repo.
#!/bin/bash
# MUSTAFA ILKER SARAC
# This script can be used for building multiple react-native apps from a single git repo.
# It needs master files for the default configurations.
# master files are generally the copy of the current config files of that git repo.
# If current state of the app changes i.e. adding new 3rd party components so package.json changes;
# then one should be responsible to reflect these changes to the master files to be synced with the current state of the repo.
# This script can be used to alter the current state, so that new apps could be generated with new names etc.
# scriptAndroid.sh
# "chmod +x ./scriptAndroid" to make script executable.
# Install dnsmasq
brew install dnsmasq
# Copy the default configuration file.
cp $(brew list dnsmasq | grep /dnsmasq.conf.example$) /usr/local/etc/dnsmasq.conf
# Copy the daemon configuration file into place.
sudo cp $(brew list dnsmasq | grep /homebrew.mxcl.dnsmasq.plist$) /Library/LaunchDaemons/
# Start Dnsmasq automatically.
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
@phanan
phanan / runner.js
Last active September 22, 2022 11:05
Record a webpage with PhantomJS and FFMpeg
// Run this from the commandline:
// phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 24 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart output.mp4
var page = require('webpage').create(),
address = 'http://s.codepen.io/phanan/fullembedgrid/YPLewm?type=embed&safe=true&_t=1424767252279',
duration = 3, // duration of the video, in seconds
framerate = 24, // number of frames per second. 24 is a good value.
counter = 0,
width = 500,
height = 500;

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

# coding=UTF-8
from __future__ import division
import nltk
from collections import Counter
# This is a simple tool for adding automatic hashtags into an article title
# Created by Shlomi Babluki
# Sep, 2013
@ogrrd
ogrrd / dnsmasq OS X.md
Last active May 3, 2024 08:33
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google