Skip to content

Instantly share code, notes, and snippets.

Code
$("button").single_double_click(function () {
alert("Try double-clicking me!")
}, function () {
alert("Double click detected, I'm hiding")
$(this).hide()
})
@weakish
weakish / rotate_screen
Created August 2, 2010 07:44
rotate screen under X window system
Use the xrandr command:
xrandr -o normal|inverted|left|right
If you want permanent changes, use this option in the "Monitor" section of
/etc/X11/xorg.conf:
Option "Rotate" "right"
@140bytes
140bytes / LICENSE.txt
Created May 9, 2011 16:13
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 17, 2024 23:43
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
---
layout: none
---
{"items":[
{% for post in site.posts %}{"title":"{{ post.title }}",
"url":"{{ post.url }}",
"date":"{{ post.date | date_to_string }}",
"body":"{{ post.content | strip_html | xml_escape | strip_newlines }}"}{% unless forloop.last %},{% endunless %}{% endfor %}
]}
@bign8
bign8 / config_sample.php
Last active August 29, 2015 13:56
An abstraction of PHP's PDO.
<?php
class config {
// For PHPMailer Class for sending email from forms and error reports
const defaultEmail = '';
const defaultFrom = '';
const notifyEmail = '';
const notifyName = '';
// For database connection scheme
@mrzmyr
mrzmyr / app.js
Last active January 6, 2019 07:31
AngularJS – readmore directive
angular.module('app', [])
.filter('truncate', function () {
return function (text, length, end) {
if (isNaN(length)) {
length = 10;
}
if (end === undefined) {
end = '...';
@domenic
domenic / 0-github-actions.md
Last active May 26, 2024 07:43
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@parmentf
parmentf / GitCommitEmoji.md
Last active June 19, 2024 11:33
Git Commit message Emoji
@walm
walm / main.go
Last active May 15, 2024 06:01
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)