Skip to content

Instantly share code, notes, and snippets.

View turboBasic's full-sized avatar
🔮
Focusing

andriy melnyk turboBasic

🔮
Focusing
View GitHub Profile
@pksunkara
pksunkara / config
Last active June 29, 2024 11:23
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@hSATAC
hSATAC / 256color.pl
Created July 20, 2011 14:48
256color.pl
#!/usr/bin/perl
# Author: Todd Larason <jtl@molehill.org>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {
@TaoK
TaoK / Invoke-ElevatedCommand.ps1
Created January 9, 2012 09:33
Invoke-ElevatedCommand for Administrator-level commands in a common powershell pipeline
Function Invoke-ElevatedCommand {
<#
.DESCRIPTION
Invokes the provided script block in a new elevated (Administrator) powershell process,
while retaining access to the pipeline (pipe in and out). Please note, "Write-Host" output
will be LOST - only the object pipeline and errors are handled. In general, prefer
"Write-Output" over "Write-Host" unless UI output is the only possible use of the information.
Also see Community Extensions "Invoke-Elevated"/"su"
.EXAMPLE
@dlutzy
dlutzy / gist:2469037
Created April 23, 2012 05:59
Multi VM Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# David Lutz's Multi VM Vagrantfile
# inspired from Mark Barger's https://gist.github.com/2404910
boxes = [
{ :name => :web, :role => 'web_dev', :ip => '192.168.33.1', :ssh_port => 2201, :http_fwd => 9980, :cpus =>4, :shares => true },
{ :name => :data, :role => 'data_dev', :ip => '192.168.33.2', :ssh_port => 2202, :mysql_fwd => 9936, :cpus =>4 },
{ :name => :railsapp, :role => 'railsapp_dev', :ip => '192.168.33.3', :ssh_port => 2203, :http_fwd => 9990, :cpus =>1}
]
@danieldbower
danieldbower / ClipboardUtils.groovy
Created May 31, 2012 18:31
Working with the System Clipboard from Groovy
import java.awt.datatransfer.StringSelection
import java.awt.Toolkit
import java.awt.datatransfer.*
class ClipboardUtils{
static final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard()
static void setClipboardContents(final String contents){
clipboard.setContents(new StringSelection(contents), null)
}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 29, 2024 08:12
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@crazy4groovy
crazy4groovy / MockFor.groovy
Created June 23, 2012 17:16
Groovy MockFor example
//http://groovy.codehaus.org/Using+MockFor+and+StubFor
import groovy.mock.interceptor.*
/*sample data class*/
class Movie {
// Lots of expensive method calls, etc.
}
/*helper class*/
@asabaylus
asabaylus / gist:3071099
Created July 8, 2012 14:12
Github Markdown Heading Anchors

Anchors in Markdown

To create an anchor to a heading in github flavored markdown. Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading) so your link should look like so:

[create an anchor](#anchors-in-markdown)

@beh
beh / gist:3549933
Created August 31, 2012 07:40
Add bookmark to pinbord.in with predefined tag, without user intervention
javascript:q=location.href;if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;void(open('https://pinboard.in/add?later=yes&noui=yes&jump=close&tags=TAGS GO HERE&url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p),'Pinboard','toolbar=no,width=100,height=100'));
// Copy and paste the above into a new bookmark. Replace "TAGS GO HERE" with your tags. Presto!
@kyle-herzog
kyle-herzog / ConvertTo-Boolean.ps1
Created October 28, 2012 00:47
Convert common values to Powershell boolean values $true and $false
function ConvertTo-Boolean
{
param
(
[Parameter(Mandatory=$false)][string] $value
)
switch ($value)
{
"y" { return $true; }
"yes" { return $true; }