Skip to content

Instantly share code, notes, and snippets.

View HashNuke's full-sized avatar
💭
Life happened. I now have varied interests. I may be slow to respond.

Akash Manohar HashNuke

💭
Life happened. I now have varied interests. I may be slow to respond.
View GitHub Profile
@HashNuke
HashNuke / lace-usage
Created September 14, 2011 17:26
Semantic CSS with Twitter's Bootstrap
/* Next time you want to make a row or column,
use the .grid_row or .grid_col(n) mixin and be happy!
*/
.post {
.grid_row;
.post_date {
.grid_cols(3);
}
updateSize: function(width, height){
// get current center
var centerX = this.pos.x + this.size.x/2,
centerY = this.pos.y + this.size.y/2;
// set new width / height
this.size.x = width;
this.size.y = height;
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@HashNuke
HashNuke / init.el
Last active December 17, 2015 03:49
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
;; under mac, have Command as Meta and keep Option for localized input
(when (string-match "apple-darwin" system-configuration)
(setq mac-allow-anti-aliasing t)
(setq mac-command-modifier 'meta)

These are notes for using the "Salt in 60 seconds" tutorial with DigitalOcean - http://www.saltstat.es/posts/quickstart.html

After creating a droplet via their web interface, login with you IP address and the password that is emailed to you.

export IP=your-ip
ssh root@$IP

Install saltstack

curl -L http://bootstrap.saltstack.org | sudo sh -s -- -M stable
@HashNuke
HashNuke / auto-scroll-explanation.coffee
Last active December 21, 2015 16:09
Autoscroll implementation in CoffeeScript. From my latest hobby project. If the user is reading history that's way behind, then do not scroll to the latest message. If the user is reading history that's less than 4 lines away from the latest message, then scroll to the latest message.
# My markup looks like this
#
# <div class="activities">
# <div class="activities-inner-wrapper">
# <div class="activity">something here</div>
# <div class="activity">another thing here</div>
# <div class="activity">Wowowowowwo</div>
# </div>
# </div>
#
@HashNuke
HashNuke / riak-advanced-config-start.txt
Last active December 29, 2015 21:08
Riak doesn't start when I add an etc/advanced.config. When there's none, it starts fine.
# I'm using Riak v2.0pre7 (latest tagged release from the github repo)
$ cat etc/advanced.config
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
[
{riak_kv, [
{add_paths, ["/Users/akashmanohar/projects/rinket/_build/shared/lib/firebrick/ebin"]}
]}
]
@HashNuke
HashNuke / riak.conf
Created April 15, 2014 02:55
riak disable javascript VMs.
# along with other config options
javascript.map_pool_size
javascript.reduce_pool_size
javascript.hook_pool_size
== Compilation error on file lib/phoenix/examples/router.ex ==
could not compile dependency phoenix, mix compile failed. You can recompile this dependency with `mix deps.compile phoenix` or update it with `mix deps.update phoenix`
** (CompileError) deps/phoenix/lib/phoenix/examples/router.ex:1: def users_comments_path/1 has default values and multiple clauses, use a separate clause for declaring defaults
(elixir) src/elixir_def.erl:286: :elixir_def.store_each/8
(elixir) src/elixir_def.erl:101: :elixir_def.store_definition/9
(stdlib) erl_eval.erl:657: :erl_eval.do_apply/6
(stdlib) erl_eval.erl:121: :erl_eval.exprs/5
/tmp/build_af8985d4-6c77-4ac3-a850-adbd1bd91562/deps/phoenix/lib/phoenix/examples/router.ex:1: Phoenix.Router.Mapper.__before_compile__/1
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:background">@color/app_bg</item>
<item name="android:actionBarStyle">@style/AppActionBar</item>
</style>