Skip to content

Instantly share code, notes, and snippets.

View feryardiant's full-sized avatar
🎯
Focusing

Fery Wardiyanto feryardiant

🎯
Focusing
View GitHub Profile
@brentertz
brentertz / rvm2rbenv.txt
Created November 21, 2011 23:00
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@yorickvP
yorickvP / boxblurcanvas.js
Created January 16, 2012 14:31
Fast canvas box blur
/*
BoxBlur - a fast almost Box Blur For Canvas
Edited by Yorick to make it faster in modern browsers
Version: 0.3
Author: Mario Klingemann
Contact: mario@quasimondo.com
Website: http://www.quasimondo.com/
@drewjoh
drewjoh / custom.js
Created January 27, 2012 13:55
Dynamic (AJAX) loaded Bootstrap Modal (Bootstrap 2.1)
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 7, 2024 07:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@DamianZaremba
DamianZaremba / install_sublime_text.sh
Last active May 25, 2021 21:01
Install sublime text on linux
cd /usr/src/
wget http://c758482.r82.cf2.rackcdn.com/sublime-text_build-3047_i386.deb
dpkg -i sublime-text_build-3047_i386.deb
@JeffreyWay
JeffreyWay / set-value.md
Created July 28, 2012 19:09
PHP: Set value if not exist

You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:

name = name || 'joe';

This is quite common and very helpful. Another option is to do:

name || (name = 'joe');
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@Asmod4n
Asmod4n / html5-notifications.js
Last active June 18, 2019 22:57
A Polyfill to fix the differences in WebKit, Blink and Gecko HTML5 Desktop Notifications, also adds a way to add your own Javascript Notifications in case your Browser doesn't support them natively.
/*
Copyright (C) 2013 Hendrik Beskow
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@mikemurray
mikemurray / Gruntfile.js
Created July 26, 2013 22:02
Gruntfile for PHP and LESS with livereloading
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
php: {
dev: {
options: {
hostname: '127.0.0.1',
@ericandrewlewis
ericandrewlewis / gist:8290246
Last active January 2, 2016 10:29
WordPress Post Meta ideas
<?php
/**
* Post Meta Box view/controller class.
*
* Extends from a form object base class.
*
* Creates a meta box. Fields can be related to the meta box, but
* all business logic lives within the field object.
*/