Skip to content

Instantly share code, notes, and snippets.

View x1unix's full-sized avatar
:shipit:
Work in progress

Denys Sedchenko x1unix

:shipit:
Work in progress
View GitHub Profile
@x1unix
x1unix / jshipster_and_and.js
Last active August 29, 2015 14:26 — forked from berzniz/jshipster_and_and.js
Some small javascript hacks for hipsters
// Boring
if (isThisAwesome) {
alert('yes'); // it's not
}
// Awesome
isThisAwesome && alert('yes');
// Also cool for guarding your code
var aCoolFunction = undefined;
@x1unix
x1unix / .htaccess
Created November 29, 2015 04:30 — forked from jxnblk/.htaccess
.htaccess for using AngularJS's in HTML5 mode on Media Temple
Options +FollowSymLinks
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
</ifModule>
@x1unix
x1unix / 0-react-hello-world.md
Created December 16, 2015 00:35 — forked from danawoodman/0-react-hello-world.md
React Hello World Examples
@x1unix
x1unix / sublime-text-3-build-3065-license.md
Created January 14, 2016 08:50
Sublime Text 3 (build 3065+) Single User License; January 9, 2016

SublimeText3 Valid License without cracking! Just download/install then use this license.
If you need 2 User License just follow J2Team Gist

How to activate license key?

  1. Go to menu Help > Enter License.
  2. Copy the license key below and paste it into the textbox > Click the Use License button.
  3. Enjoy!

🔔 NOTE: If you can, please buy software license to support the authors and developers!

@x1unix
x1unix / Sublime Text License Key.md
Created January 14, 2016 08:51
Sublime Text 2 License Key, Sublime Text 3 License Key, Sublime Text Full Version.
@x1unix
x1unix / skeleton-daemon.sh
Created April 18, 2016 16:03 — forked from shawnrice/skeleton-daemon.sh
A template to write a quick daemon as a bash script
#!/bin/sh
# This is a skeleton of a bash daemon. To use for yourself, just set the
# daemonName variable and then enter in the commands to run in the doCommands
# function. Modify the variables just below to fit your preference.
daemonName="DAEMON-NAME"
pidDir="."
pidFile="$pidDir/$daemonName.pid"
@x1unix
x1unix / hosts
Created May 5, 2016 18:48 — forked from eyecatchup/hosts
Disable Skype ads: 1.) Add hosts to your hosts file 2.) Flush DNS resolver cache (ipconfig /flushdns)
# Block Skype ads
127.0.0.1 *.msads.net
127.0.0.1 *.msecn.net
127.0.0.1 *.rad.msn.com
127.0.0.1 a.ads2.msads.net
127.0.0.1 ac3.msn.com
127.0.0.1 ad.doubleclick.net
127.0.0.1 adnexus.net
127.0.0.1 adnxs.com
127.0.0.1 ads1.msn.com
@x1unix
x1unix / trigger.sql
Created May 9, 2016 11:52 — forked from dnozay/trigger.sql
mysql change value on insert/update
-- example mysql triggers that change column values
-- before they are inserted/updated.
-- use case: when building code that comes from a git repository
-- we want to track the branch information, but some of the jobs
-- building the product use references rather than short names.
-- e.g. refs/remotes/origin/my/branch rather than origin/my/branch.
delimiter //
@x1unix
x1unix / gist:a8bd21070ef2c37dbad23b0805866a30
Created June 6, 2016 06:28 — forked from scmx/upgrade-install-ruby-2-1-2-ubuntu-12-04.md
Upgrade/Install ruby 2.1.2 #ubuntu #12.04 #14.04
# Reference http://stackoverflow.com/a/18490935/2037928
# Login as root
# Install needed packages
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
# Download appropriate ruby version https://www.ruby-lang.org/en/downloads/
@x1unix
x1unix / validate_credit_card.js
Created June 9, 2016 12:14 — forked from DiegoSalazar/validate_credit_card.js
Luhn algorithm in Javascript. Check valid credit card numbers
// takes the form field value and returns true on valid number
function valid_credit_card(value) {
// accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
var nCheck = 0, nDigit = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {