Skip to content

Instantly share code, notes, and snippets.

View chew-z's full-sized avatar

Robert J. chew-z

  • Warsaw, Poland
View GitHub Profile
@akamola
akamola / Perl.sublime-build
Created March 15, 2013 12:06
Sublime Text 2: Build system for Perl
{
"cmd": ["perl", "-w", "$file"],
"file_regex": ".* at (.*) line ([0-9]*)",
"selector": "source.perl"
}
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active March 25, 2025 18:03
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@ckng
ckng / gist:5889994
Created June 29, 2013 05:46
lazy load bootstrap carousel
$('#myCarousel').on('slid', function() {
var $nextImage = $('.active.item', this).next('.item').find('img');
$nextImage.attr('src', $nextImage.data('lazy-load-src'));
});
@currencysecrets
currencysecrets / isPinBar.mq4
Last active December 19, 2015 10:49
This function returns a boolean result on passing in an open, high, low and close price as well as the direction (true = bullish; false = bearish).
/** v6.0
* A pin bar is a hammer like formation where the body of the candle
* is at one extreme of the entire candle and the wick making up the
* remainder of the candle. The body of the candle should be no more
* than 1/3 of the entire candle, with the remaining wick taking up
* no more than 2/3 of the remainder of the body.
*/
bool isPin( double o, double h, double l, double c, bool isLong ) {
double hx, lx, rng = h - l, pct = 1/3;
if ( isLong ) {
@plentz
plentz / nginx.conf
Last active May 3, 2025 05:27
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@nanusdad
nanusdad / git-init-repo-from-dir
Created October 28, 2013 23:12
GitHub - initialize from existing directory
Create the remote repository, and get the URL such as
[email protected]:/youruser/somename.git or https://github.com/youruser/somename.git
If your local GIT repo is already set up, skips steps 2 and 3
Locally, at the root directory of your source, git init
Locally, add and commit what you want in your initial repo
@paulmach
paulmach / serve.go
Last active January 26, 2025 18:27
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
@fcrespo82
fcrespo82 / due.py
Created December 18, 2013 21:22
Send Due tasks from any computer with Python
#! /usr/bin/env python
import pushover
import sys
import datetime
import dateutil.parser
import urllib
DUE_URL = "due://x-callback-url/add?title={0}&duedate={1}&timezone=GMT"
@cleverdevil
cleverdevil / markdown-to-email
Created January 4, 2014 01:06
markdown-to-email A simple script to send beautifully formatted emails that you write in Markdown. The email will have an HTML payload and a plain-text alternative, so you'll make everyone happy, including yourself.
#!/usr/bin/env python
'''
Send an multipart email with HTML and plain text alternatives. The message
should be constructed as a plain-text file of the following format:
From: Your Name <[email protected]>
To: Recipient One <[email protected]>
Subject: Your subject line
---
@apisznasdin
apisznasdin / nginx-blacklist.conf
Last active May 19, 2019 04:54
This file implements a blacklist for certain user agents and referrers. It's a first line of defense. It must be included inside a http block in nginx configuration file.
### This file implements a blacklist for certain user agents and
### referrers. It's a first line of defense. It must be included
### inside a http block.
# based from https://github.com/perusio/piwik-nginx/blob/master/blacklist.conf
# blacklist from http://perishablepress.com/2013-user-agent-blacklist/
## Add here all user agents that are to be blocked.
map $http_user_agent $bad_bot {
default 0;