Skip to content

Instantly share code, notes, and snippets.

View chakrihacker's full-sized avatar
🎯
Focusing

Subramanya Chakravarthi chakrihacker

🎯
Focusing
View GitHub Profile
@Kilian
Kilian / annoying.js
Created January 6, 2011 15:04
How to be an asshole
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@oscarryz
oscarryz / gist:4121184
Created November 20, 2012 21:14
Brief history of Objective-C square brackets

Brief history of the "square brackets" as I remember it.

One of the most challenging aspects of the language are the square brackets because they look like arrays, as you just mention.

As I remember the language was inspired in smalltalk, but using C to gain speed.

The idea behind smalltalk was to send message as we do with real life objects. For instance if I ask you your age I would say something like this in natural language:

@tonylukasavage
tonylukasavage / script.sh
Created May 29, 2013 18:18
Move all uncommitted changes to a new branch and revert the existing branch to HEAD. "master" has uncommitted changes. You decided you'd rather make those changes in "dev_branch". Here's how to move those uncommitted changes to "dev_branch" and then revert "master" to its last commit.
# get into the master branch
git checkout master
# create a new branch for the changes and check it out
git checkout -b dev_branch
# stash the changes until we revert master
git stash
# go back to master
@codeboxr
codeboxr / gist:5820819
Last active December 18, 2015 17:49
Sending Customized User Registration Email Alert to Admin in Moodle step2 From My blog post: http://codeboxr.com/blogs/sending-customized-user-registration-email-alert-to-admin-in-moodle
/**
* Send email to specified user with confirmation text and activation link.
*
* @global object
* @param user $user A {@link $USER} object
* @return bool Returns true if mail was sent OK and false if there was an error.
*/
//update by codeboxr
function send_confirmation_email($user) {
@codeboxr
codeboxr / gist:5820826
Last active December 18, 2015 17:49
Sending Customized User Registration Email Alert to Admin in Moodle - Step1 From My blog post: http://codeboxr.com/blogs/sending-customized-user-registration-email-alert-to-admin-in-moodle
$string['emailconfirmationtoadmin'] = 'Hi {$a->supportname},
A new account \'{$a->firstname}\' has been requested at \'{$a->sitename}\'
{$a->admindata}';
@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@hofmannsven
hofmannsven / README.md
Last active December 8, 2025 16:31
Git CLI Cheatsheet
@joyrexus
joyrexus / README.md
Last active December 14, 2025 02:33 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@rosswd
rosswd / multi-git-win.md
Last active November 19, 2025 00:02
Setting up a Github and Bitbucket account on the same computer on Mac OS. Now with a guide for Windows 10.

Setting up github and bitbucket on the same computer (Windows)

Guide for Windows

mix3d asked for some help using this guide with windows so here we go. This was tested with Windows 10. Run all commands in Git Bash once it's installed.

Github will be the main account and bitbucket the secondary.

Git for Windows

  • Download and install Git for Windows
    • In the installer, select everything but decide if you want a desktop icon (2nd step)