Skip to content

Instantly share code, notes, and snippets.

@hasssan
hasssan / convert-ls-to-js.sh
Last active November 8, 2016 06:12
convert .ls to .js
#!/bin/bash
# compile to js
#find $1 -type f -name '*.ls' -exec lsc -b -c {} \;
# fix some extension from lsc compiler
#for loca in `git ls-files --others --exclude-standard`; do
# if [[ $loca != *.js ]] && [[ $loca != *.sh ]]; then
# mv "$loca" "$loca.js"
# fi
@hasssan
hasssan / key-fingerprint
Last active December 2, 2018 23:18 — forked from yosemitebandit/key-fingerprint
view your ssh public key's fingerprint; compare this to what Github has listed in the ssh key audit
$ ssh-keygen -l -f /path/to/keys/id_rsa.pub
2048 aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66:77:88:99 id_rsa.pub (RSA)
# With newer versions of ssh
# form upstream comment
$ ssh-keygen -l -E md5 -f ~/.ssh/my-github-key.pub
@hasssan
hasssan / gulpfile.js
Last active August 29, 2015 14:15 — forked from insin/gulpfile.js
var gulp = require('gulp')
var shell = require('gulp-shell')
gulp.task('build-docs', shell.task('make html', {cwd: './docs'}))
gulp.task('docs', ['build-docs'], function() {
gulp.watch(['./docs/*.rst', './docs/*.py'], ['build-docs'])
})
[alias]
st = status
ci = commit
co = checkout
cim = commit -m
ls = log --pretty=format:"%C(yellow)%h%x20%C(blue)%ad%C(red)%d%x20%C(reset)%s%C(green)%x20[%cn]" --decorate --date=short -n 20
lm = log --pretty=format:"%s" -n 20
lo = log --pretty=format:"%Cgreen%h%x20%Cblue%ar%x20%Cred%an:%x20%C(white)%s" --abbrev=8 --graph -n 20
long = log --graph --pretty=format:"%C(yellow)%h%Cblue%d%Creset%x20%s%x20%C(green)%x20%an,%x20%C(white)%ar%Creset"
mff = merge --no-ff
@hasssan
hasssan / gist:7086099
Last active December 26, 2015 03:29
My Sublime Text 2 Settings
/**
* Sublime keymap by Hassan Aly (http://hassan.web.id)
* version 1.0
*/
[
// vim like normal mode command
{ "keys": ["n", "n"], "command": "advanced_new_file", "context": [{ "key": "setting.command_mode", "operand": true }]},
{ "keys": ["z", "a"], "command": "fold", "context": [{ "key": "setting.command_mode", "operand": true }]},
{ "keys": ["z", "i"], "command": "unfold", "context": [{ "key": "setting.command_mode", "operand": true }] },
@hasssan
hasssan / gist:5432508
Created April 22, 2013 04:53
CSS: Hide text link
.logo {
background: url('images/logo.png') no-repeat transparent;
text-indent: -9999px;
overflow:hidden;
display: block;
position: relative;
}
@hasssan
hasssan / config.rb
Created March 12, 2013 09:15
Wordpress: Compass config.rb for theme development
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "."
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "javascripts"
environtment = :development
# http://stackoverflow.com/questions/10314907/getting-a-list-of-files-in-sass-compass
require File.join(File.dirname(__FILE__), 'listfiles.rb')
@hasssan
hasssan / function.php
Created March 11, 2013 07:48
Wordpress: Function.php template for better security
<?php
// A major drawback of the current WordPress login form is
// that it informs the user which part of the login information he/she has gotten wrong.
// For instance, if the username is correct and the password wrong,
// WordPress informs the user about it. This makes it easier to use brute force login
// as the hacker has a clear idea of whether he/she needs to change the username or password.
// source: http://wp.tutsplus.com/tutorials/security/wordpress-security-threats-that-you-should-look-out-for/
function failed_login () {
@hasssan
hasssan / .htaccess
Last active December 14, 2015 12:58
Wordpress: .htaccess
<files wp-config.php>
order allow,deny
deny from all
</files>
# Block the include-only files.
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]