Skip to content

Instantly share code, notes, and snippets.

View minhajuddin's full-sized avatar
⌨️
Beep boop, beep boop

Khaja Minhajuddin minhajuddin

⌨️
Beep boop, beep boop
View GitHub Profile
@minhajuddin
minhajuddin / mcrypttest.ex
Created May 17, 2016 18:58
Mcrypt using CFB
defmodule Mcrypttest do
@algo :rijndael_256
@mode :cfb
@key "00000000000000000000000000000000"
@iv "00000000000000000000000000000000"
def encrypt(plaintext) do
Mcrypt.encrypt(plaintext, @algo, @mode, @key, @iv)
end
@minhajuddin
minhajuddin / server-git.conf
Created April 13, 2016 07:40 — forked from massar/server-git.conf
Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# jeroen@massar.ch - http://jeroen.massar.ch
server {
listen 192.0.1.1:80;
listen [2001:db8::1]:80;
# Redirect all non-HTTPS traffic to the HTTPS variant
return 301 https://$host$request_uri;
}
# https://minhajuddin.com/2016/03/03/put-this-in-your-code-to-debug-anything
require 'rouge'
require 'method_source'
require 'pp'
class Dbg
def initialize(object, to:)
@object, @stream = object, to
end
@minhajuddin
minhajuddin / grunt-hugo-lunrjs.md
Created February 3, 2016 01:57 — forked from sebz/grunt-hugo-lunrjs.md
hugo + gruntjs + lunrjs = <3 search
@minhajuddin
minhajuddin / br.sh
Created February 2, 2016 05:48 — forked from dmkash/br.sh
Shell Script for tmux setup
#!/bin/sh
SESSION_NAME="big_red"
cd ~/Sites/within3/big_red
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then
@minhajuddin
minhajuddin / springer-free-maths-books.md
Created December 29, 2015 08:29 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@minhajuddin
minhajuddin / README.md
Last active August 29, 2015 14:18 — forked from sumskyi/README.md

irb(main):029:0* GeoEntity.last

GeoEntity Load (0.5ms) SELECT geo_entities.* FROM geo_entities ORDER BY geo_entities.id DESC LIMIT 1

returns:

County id: 4, eid: nil, pid: nil, ename: nil, etype: 2, created_at: "2011-11-21 06:26:37", updated_at: "2011-11-21 06:26:37"

gem 'rom', '0.6.0'
gem 'rom-sql', '0.4.0'
gem 'rom-rails', '0.3.0'
gem_group(:test) do
gem "rspec"
gem "rspec-rails"
gem "capybara"
gem "database_cleaner"
gem "spring-commands-rspec"
@minhajuddin
minhajuddin / Task-0.md
Last active August 29, 2015 13:57 — forked from abdulsattar/Task.md

#0.1 Note taking application

It should display Notes section, a textbox and an add note button. Screenshot

#0.2 Calculator It should display two inputs, with add/subtract/multiply/divide buttons Screenshot

# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby