Skip to content

Instantly share code, notes, and snippets.

View kevbook's full-sized avatar

Karan Sakhuja kevbook

View GitHub Profile
@kevbook
kevbook / git-extract-file.markdown
Created November 11, 2012 16:18 — forked from ssp/git-extract-file.markdown
Extract a single file from a git repository

How to extract a single file with its history from a git repository

These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).

First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.

Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.

1. copy the repository to extract the file from and go to the desired branch

LinkedIn + tinder for hourly workers. The concept is very early, but I was wondering if you are open to contracting work to help me build out the mobile app. Examples of similar apps are: Jobr, Switch (on the US app store)
Looking for to build it with Swift. Backend tech stack is Node.JS and goLang. We want to keep our language to more functional type of languages. I know a bit of swift not objective C.
The app consists of :
1. Splash -> Overview screens.
2. Settings + Preferences + standard stuff - RESTful api backend calls with basic-auth
4. FB login -> app will use native iOS fb sdk.
5. Interactive user profile builder - RESTful api backend calls with basic-auth
6. Tinder type swipe UX to swipe for jobs instead of users - Geo Location based
@kevbook
kevbook / wanted app
Last active August 29, 2015 14:13
Wanted App
### Auth / Login
* FB login only: Scope = user_about_me,user_birthday,user_education_history,user_location,user_website, user_work_history
* App sends GET request with geo (lat, long) & FB auth_token
* Backend creates a token, app passes in 'X-Session-Token' http header in subsquent requests for authorized user
### On each app start
* send PUT request with updated geo (lat, long) to backend
* GET latest categories (
### On each app start
@kevbook
kevbook / git_stats.sh
Created January 30, 2018 06:12 — forked from lexqt/git_stats.sh
git stats: insertions, deletions, files, commits
#!/bin/bash
if [[ $1 == "" && $2 == "" ]]
then
echo "USAGE: $0 SINCE_DATE [AUTHOR_PATTERN]"
exit
fi
DATE=$1 # 10-1-2011, 2012-04-22, etc
AUTHOR=$2 # author pattern (regexp)
Thanks James, this looks great. Let me lay out a few ground rules that we follow for all node modules at Knock
1. nodev6 (since aws lambda doesn’t support v8, yet)
2. General modules we use @knock - got(http), ava(testing), lodash, aws-sdk
3. Typical function signature is usually, there are exceptions but we tend to keep things consistent
```js
/**
* @param arg1 (Required)
* @param {Object} optionalArgs (Optional, if need be)
// All of deal stuff on web + more detailed dom stuff, and below updated daily
@param market {String}
@param mls_type {String} (ga_fmls, etc)
@param type {String} (exmaple "sfr,condo")
@param city {String}
@param zipcode {String}
@param state {String}
@param knock_property {Boolean}
@kevbook
kevbook / video.html
Last active April 18, 2018 15:19
knock-how-it-works
<script src="https://fast.wistia.com/embed/medias/dtycytdh15.jsonp" async></script>
<script src="https://fast.wistia.com/assets/external/E-v1.js" async></script>
<div class="wistia_responsive_padding" style="padding:56.25% 0 0 0;position:relative;">
<div class="wistia_responsive_wrapper" style="height:100%;left:0;position:absolute;top:0;width:100%;">
<div class="wistia_embed wistia_async_dtycytdh15 videoFoam=true" style="height:100%;width:100%">&nbsp;</div>
</div></div>
@kevbook
kevbook / challenge.md
Last active April 29, 2018 17:56
React challenge

React Component - Create a standard monthly calendar component using React with these minimum requirements:

  1. The monthly calendar should label the day of the month (as a number) in a fixed 6 x 7 grid (6 rows and 7 columns).
    • All the cells of the grid should have borders
  2. Each row starts with Sunday (column 0) and ends with Saturday (column 6).
    • Add a heading above each column to represent the day of the week. (eg. Sun, Mon, Tues, ...etc)
  3. Ensure that every cell in the grid displays a number.
    • For example, the currenly selected month is May 2018.
    • May 1, 2018 is a Tuesday.
    • For row 0, column 0 show April 29. For row 0, column 1 show April 30.
  4. Set a disctint style for the currently selected month so that it stands out from cells that are outside of the currently selected month.
atlanta: {
market: 'atlanta',
state: 'ga',
address_lat: 34.0754,
address_long: -84.2938,
radius: 120000, // In meters
mls_type: 'ga_fmls',
mls_state: 'ga'
},
charlotte: {
{
"event": "invitee.created",
"time": "2018-08-27T21:49:21Z",
"payload": {
"event_type": {
"uuid": "DCDGA4N6EAE5QPPG",
"kind": "Round Robin",
"slug": "test-calendar",
"name": "Test Calendar",
"duration": 45,