Skip to content

Instantly share code, notes, and snippets.

@ten1seven
ten1seven / jquery.disableSelect.js
Created November 15, 2011 23:26
Enable/Disable text selection
jQuery.fn.disableTextSelect = function() {
return this.each(function() {
$(this).css({
'MozUserSelect':'none',
'webkitUserSelect':'none'
}).attr('unselectable','on').bind('selectstart', function() {
return false;
});
});
};
@h4cc
h4cc / Makefile
Last active July 4, 2017 23:35
Ubuntu 14.04 LTS Trusty Tahr - Basic packages i usually install
#
# Ubuntu 14.04 LTS (Trusty Tahr)
#
# Basic packages i usually install
#
# Author: Julius Beckmann <github@h4cc.de>
#
# For 16.04 Xenial Xerus: https://gist.github.com/h4cc/fe48ed9d85bfff3008704919062f5c9b
#
--
-- This is SQL query to extract AddressBook info from respective sqlite3 file from iOS backup.
-- It has been tested only on my own backup, so, if anything is wrong, fork, edit, and stuff.
--
-- # parse-manifest.py from http://stackoverflow.com/questions/3085153/how-to-parse-the-manifest-mbdb-file-in-an-ios-4-0-itunes-backup
--
-- $ python ../parse-manifest.py | grep AddressBook.sqlitedb
-- -rw-r--r-- 000001f5 000001f5 1654784 1312812502 1312812502 1287387943 (31bb7ba8914766d4ba40d6dfb6113c8b614be442)HomeDomain::Library/AddressBook/AddressBook.sqlitedb
--
-- $ sqlite3 31bb7ba8914766d4ba40d6dfb6113c8b614be442
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active May 28, 2024 06:59
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@NickCraver
NickCraver / Windows10-Setup.ps1
Last active April 1, 2024 10:52
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@varmais
varmais / thinced.js
Created October 1, 2015 19:43
Geolocation to Promise wrap example
var getPosition = function (options) {
return new Promise(function (resolve, reject) {
navigator.geolocation.getCurrentPosition(resolve, reject, options);
});
}
getPosition()
.then((position) => {
console.log(position);
})
console.log(`%c ________________________________________
< mooooooooooooooooooooooooooooooooooooo >
----------------------------------------
\\ ^__^
\\ (oo)\\_______
(__)\\ )\\/\\
||----w |
|| ||`, "font-family:monospace")
@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@jjungnickel
jjungnickel / BoxStarter.ps1
Last active May 16, 2018 00:07
My Windows 10 BoxStarter Setup
# The following settings will ask you for your windows password and then
# successfuly reboot the machine everytime it needs to. After Boxstarter is
# done autologin won't be enabled.
$Boxstarter.RebootOk=$false # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$false # Save my password securely and auto-login after a reboot
# Allow running PowerShell scripts
Update-ExecutionPolicy Unrestricted
@zloeber
zloeber / bootstrapwindows10.ps1
Last active March 12, 2024 07:39
Boxstarter Windows 10 Configuration
<#
The command to run, built from the raw link of this gist
Win+R
iexplore http://boxstarter.org/package/url?<RAW GIST LINK>
OR (if you don't like the way the web launcher force re-installs everything)