Recently was tweaking a node module and had to warn users on deprecated methods, truns out it's damn easy with util
module.
Pinch of code :
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Let's import hello.js
and try invoking hello
:
1 2 3 4 5 |
|
Happy hacking!
Recently was tweaking a node module and had to warn users on deprecated methods, truns out it's damn easy with util
module.
Pinch of code :
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Let's import hello.js
and try invoking hello
:
1 2 3 4 5 |
|
Happy hacking!
Syncing my forked repositories is the most common task I do! So wanted to automate it.
The bash script below helps me with syncing my forked code from github, without me worrying about the parent git url!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Usage :
1 2 |
|
In any github git repo you want to sync, just run sf
to sync your fork with the parent.
Hope this helps you, happy hacking! :)
I normally make a lot of refernce to lots of friends on social networks while blogging and was getting bored of adding hrefs for each reference, so made the socialink-plugin for octopress.
Place the socialink.rb
in the porject link to your ~/octopress/plugin/
dir.
1
|
|
Input:
1 2 |
|
Output:
1 2 |
|
Hope this is useful!
While working on yeoman-sublime-plugin I faced an issue with the build system :
[Errno 2] No such file or directory
for the same reason setpath was devised.
But later on a simpler method was suggest by @kevvayo :
1 2 3 4 5 |
|
The trick was all about starting the shell :-)
If you have coded some ruby you would have seen the LoadError : 'require': no such file to load -- rubygems (LoadError)
in case of the required gem is missing (not installed) or the gem path is screwed up!
Here is a simple silly old trick :
1 2 3 4 5 6 7 8 |
|
Using it :
1 2 3 4 5 6 7 8 |
|
Well something like Bundler must be used at any case! This is just some undocumented old code.
It was fun tweetcoding with @jsbin [ aka @rem ;) ]. This is a simple octopress jsbin plugin that helps to partial embed jsbins.
It all begin with :
@GNUmanth race ya! (to the PR)
— Dave, the JS Bin Bot (@js_bin) July 23, 2013
And after two PRs it was all ready :-) The below is a simple embed :
Do checkout the plugin and contribute! Thanks to Remy Sharp.
Let the code doing the talking! Feel free to fiddle around.
There are few HTTP status serivce apps, /me pawed a bit with node to do the same. Do try HSCO.
The code is plain and simple :
1 2 3 4 5 6 7 8 |
|
Well, this can be improved futher...this is just the first cut.
Avoid rewriting history with rebase
or roll back and re-commit and use the below in your git/hooks/pre-commit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
In the Gruntfile.js
(As of now I'm using mocha, so..)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Well ofcourse, this can be imporved for release tasks as well :-)
This is one of those fun time CLI hacks, it helps you to automatically tweet about every git commits that happen in the current repo.
I shall not say much about grunt.js or git hooks in the post, but rather will let the code do the talking.
Prereq :
1 2 |
|
Keys listed below can be obtained from dev.twitter.com after setting up a new App
Custom grunt tweet task :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Have a pre-commit hooks at .git/hooks/pre-commit
as grunt tweet
would tweet on every commit!
The tweet would be something like : 'jshint suggestions from @passy on yo.git by Hemanth.HM'