Skip to content

Instantly share code, notes, and snippets.

#!/usr/local/bin/node
/* ProductHunt posts upvotes count and Emoji on change :)
* BitBar plugin
*
* by Varun Malhotra
* (c) 2016
* LICENSE - MIT
*
* Shows current votes count of each post and notification bell (🔔) on change
@EtienneR
EtienneR / user.js
Created January 7, 2016 23:39
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);
@geovanisouza92
geovanisouza92 / README.md
Last active April 30, 2016 11:22
Script to convert TextExpander snippets to Texpand

Usage:

$ ./te2t.py <.textpander file> <.txt file>

Import the .txt file into Texpand app.

@theturbofd
theturbofd / ExcelAuto.ps1
Last active March 1, 2016 08:49
Excel Automation Public
#-----------Lets you select the file----------------------------
Function Get-OpenFile($initialDirectory){
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
$OpenFile = New-Object System.Windows.Forms.OpenFileDialog
$OpenFile.initialDirectory = $initialDirectory
$OpenFile.Title = "Choose report to open"
$OpenFile.filter = "All files (*.xlsx*)| *.xlsx*"
$OpenFile.DefaultExt = "xlsx"
$OpenFile.AddExtension = $True
if($openFile.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK){
@ctigeek
ctigeek / Get-DotNetVersion.ps1
Last active December 11, 2015 20:55
Get the versions and SPs on the current machine (default), or an array of machines piped in.
function Get-DotNetVersion {
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline=$True)] [object] $ComputerName
)
BEGIN {
}
PROCESS {
if (-not $ComputerName) {
@SykoTheKiD
SykoTheKiD / getSelectedOrURL.js
Created November 23, 2015 19:48
A JavaScript function for the Chrome Extension API that can get the highlighted text on a page or the tab URL if no text is highlighted
function getSelectedOrURL(callback) {
chrome.tabs.query({
active: true,
windowId: chrome.windows.WINDOW_ID_CURRENT
}, function(tab) {
chrome.tabs.sendMessage(tab[0].id, {
method: "getSelection"
}, function(response) {
if (response.data === null) {
chrome.tabs.query({
@ryanburgess
ryanburgess / app.js
Last active February 18, 2019 07:57
Example API using Express and Cheerio.
var express = require('express');
var cheerio = require('cheerio');
var request = require('request');
var app = express();
var wordOfDay = [];
app.get('/', function (req, res) {
// allow access from other domains
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'X-Requested-With');
@lee-dohm
lee-dohm / atom-version.rb
Last active November 2, 2015 23:24
Atom and OS Version Text Expander Snippets (for OS X)
#!/usr/bin/env ruby
atom_version = `/usr/local/bin/atom --version`.chomp
print "Atom v#{atom_version}"
@RafPe
RafPe / AutoMarkdown.ps1
Last active December 3, 2017 23:00
Autodocument your Powershell modules using Markdown
param
(
[string]$PathToModule='C:\temp\Cos.psm1',
[string]$ModuleName = 'cos',
[string]$OutputFolderPath='C:\temp',
[string]$ResultFileNamePrefix='cos_module',
[string]$ResultFileNameSuffix = 'md'
)