Skip to content

Instantly share code, notes, and snippets.

View keevitaja's full-sized avatar
💭
building jedmud

Tanel Tammik keevitaja

💭
building jedmud
View GitHub Profile
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@davidgomes
davidgomes / How to change Pantheon Terminal's color scheme.md
Created March 14, 2013 16:53
How to change Pantheon Terminal's color scheme

How to change Pantheon Terminal's color scheme

Many of us spend many hours of our days using their terminal. Plus, we all have different tastes when it comes to color schemes. That's why the ability to change the color scheme of a terminal is one of its more important featuresl. Throughout this tutorial, I'll teach you how you can change the looks of your terminal, step by step.

This tutorial is aimed at elementary OS users, but it also works for any Ubuntu user. Start by installing dconf-tools:

sudo apt-get install dconf-tools

Secondly, you need to decide which theme you're going to apply. You can find dozens of terminal color schemes online, you can even design your own using this web application. Design the color scheme, hit "Get Scheme" and choose "Terminator". You'll get a raw text file with a background color, a foreground color and a palette. Those strings define your color scheme. In this tutorial, I'll post an

@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@msurguy
msurguy / List.md
Last active April 30, 2024 15:14
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

-- class implementation
local function class(t)
t.__index = t
return t
end
local function extend(dst,src)
for k,v in pairs(src) do
if type(k) == "string" and k:sub(1,1) ~= "_" then
dst[k] = dst[k] or v
end
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
//$client->setDefaultOption('auth', array('username', 'password', 'Basic|Digest|NTLM|Any'));
$client->setDefaultOption('auth', array('DjangoFR', '********', 'Basic'));
$res = $client->get('http://www.example.com/system/get_user_categories/format/json/user_id/**10**');
@laptrinhcomvn
laptrinhcomvn / Sublime Text 3 cheating.md
Last active November 17, 2023 06:53
Sublime Text 3 patching

Ref: https://gist.github.com/vertexclique/9839383

Important Note

Please use built-in Terminal.app (of Mac OS X) to type and rune the command, do not use another tool (like iTerm2).

Common step after enter run the patch command:

  • After run the commands, start new Sublime Text app, go to Main Menu > Help > Enter License. On the popup type in any text (example "a") and click Use Licence .
@adamwathan
adamwathan / 1.md
Created August 20, 2015 16:28
Move vertically quickly in Sublime Test

Option + left/right is awesome for jumping around quickly horizontally, but if you're like me, you've probably tried to use that same muscle memory to jump vertically by using option + up/down.

Here's a few macros you can use to accomplish that, as well as creating selections while jumping vertically as well.

Add these shortcuts and you'll be in bizniz:

    //...
    { "keys": ["alt+up"], "command": "run_macro_file", "args": {"file": "Packages/User/move_3_lines_up.sublime-macro"} },
 { "keys": ["alt+down"], "command": "run_macro_file", "args": {"file": "Packages/User/move_3_lines_down.sublime-macro"} },
@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 4, 2024 09:43
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub