Skip to content

Instantly share code, notes, and snippets.

View shmuelie's full-sized avatar

Shmueli Englard shmuelie

View GitHub Profile
@sindresorhus
sindresorhus / countrycode-latlong-array.json
Created November 5, 2011 16:03
Country codes (ISO 3166) to latitude longitude - converted from http://www.maxmind.com/app/country_latlon
{
"ad": [
"42.5000",
"1.5000"
],
"ae": [
"24.0000",
"54.0000"
],
"af": [
@jpoehls
jpoehls / output.txt
Created March 26, 2012 16:48
PowerShell benchmarking function. Or, the Windows equivalent of Unix's `time` command.
PS> time { ping -n 1 google.com } -Samples 10 -Silent
..........
Avg: 62.1674ms
Min: 56.9945ms
Max: 87.9602ms
PS> time { ping -n 1 google.com } -Samples 10 -Silent -Long
..........
Avg: 00:00:00.0612480
Min: 00:00:00.0572167
@dankrause
dankrause / _hover_example.py
Last active September 10, 2024 19:45
Example code to use the (unofficial, unsupported, undocumented) hover.com DNS API.
import requests
class HoverException(Exception):
pass
class HoverAPI(object):
def __init__(self, username, password):
params = {"username": username, "password": password}
r = requests.post("https://www.hover.com/api/login", params=params)
@bitcrazed
bitcrazed / boxstarter.ps1
Last active November 3, 2022 21:31
Boxstarter script
# Description: Boxstarter Script
# Author: Rich Turner <[email protected]>
# Last Updated: 2019-07-08
#
# Run this Boxstarter by calling the following from an **ELEVATED PowerShell instance**:
# `set-executionpolicy Unrestricted`
# `. { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force`
# `Install-BoxstarterPackage -DisableReboots -PackageName <URL-TO-RAW-GIST>`
#---- TEMPORARY ---
@napsternxg
napsternxg / progress.c
Created April 10, 2015 22:28
Progress bar and progress percentage in C.
/**
* progress.c - Progress bar and progress percentage in C.
* This program uses ANSI escape codes to show an always updating progress line in the terminal.
* Author: Shubhanshu Mishra
**/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@mattjohnsonpint
mattjohnsonpint / Program.cs
Last active October 5, 2024 23:31
Airport Time Zones
using System.Text.RegularExpressions;
using GeoTimeZone; // Import from Nuget package "GeoTimeZone" (https://github.com/mattjohnsonpint/GeoTimeZone)
using TimeZoneConverter; // Import from Nuget package "TimeZoneConverter" (https://github.com/mattjohnsonpint/TimeZoneConverter)
namespace AirportTimeZones;
internal static class Program
{
private static void Main()
{
@ferventcoder
ferventcoder / RubyStack.ps1
Last active April 5, 2018 17:48
Full Ruby Stack Install using Chocolatey and PowerShell
# https://github.com/chocolatey/choco/wiki/CommandsReference#how-to-pass-options--switches
# Powershell specific argument passing
# You must be on the latest beta of chocolatey for this to work properly (redownload files)
choco upgrade chocolatey -pre
$originalPath = $env:PATH
choco install ruby --version 1.9.3.55100 -my --install-arguments '/verysilent /dir=""c:\tools\ruby193"" /tasks=""assocfiles""' --override-arguments
# DevKit for Ruby 1.x
@wsargent
wsargent / win10-dev.md
Last active August 7, 2024 18:20
Windows Development Environment for Scala

Windows 10 Development Environment for Scala

This is a guide for Scala and Java development on Windows, using Windows Subsystem for Linux, although a bunch of it is applicable to a VirtualBox / Vagrant / Docker subsystem environment. This is not complete, but is intended to be as step by step as possible.

Harden Windows 10

Read the entire Decent Security guide, and follow the instructions, especially:

@comargo
comargo / README.md
Last active June 28, 2024 15:52
OutputDebugString with cpp std::ostream

Sven Axelsson 24 Nov 2001

How to create an output stream that writes to the debug terminal.

Background

There are many different schools of how to debug a program (yeah, I know - write it correctly from the start), but whatever tools you prefer it is often very convenient just to use the printf approach. Well, since you are a modern C++ kind of person, you don't really want printf, you want to use an output stream, like cerr.

@gvenzl
gvenzl / One Liner to download the latest release from your GitHub repo.md
Last active October 14, 2024 20:05
One Liner to download the latest release from your GitHub repo
LOCATION=$(curl -s https://api.github.com/repos/<YOUR ORGANIZTION>/<YOUR REPO>/releases/latest \
| grep "zipball_url" \
| awk '{ print $2 }' \
| sed 's/,$//'       \
| sed 's/"//g' )     \
; curl -L -o <OUTPUT FILE NAME> $LOCATION

for example: