Skip to content

Instantly share code, notes, and snippets.

@mayconbordin
mayconbordin / progress_bar.php
Created June 2, 2012 23:55
PHP CLI progress bar in 5 lines of code
<?php
function progress_bar($done, $total, $info="", $width=50) {
$perc = round(($done * 100) / $total);
$bar = round(($width * $perc) / 100);
return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info);
}
#!/bin/sh
/Applications/Discord.app/Contents/MacOS/Discord --proxy-server=http://po.cc.ibaraki-ct.ac.jp:3128
@TheoKondak
TheoKondak / LG HUB - Copy Settings to Multiple Accounts.md
Last active May 1, 2024 15:56
How to migrate Logitech HUB Profile details to another Windows Account/Device

The Problem:

I want to use Logitech Hub profiles in multiple Windows accounts and multiple Windows Devices. Logitech Hub allows me to upload a profile linked to my account or public, when I download the profile on the second account/machine, the profile is being assigned to the default profile. I was not able to find a way to reassign macros etc to the actual Application profile.

The Solution:

The problem is that in each instance of Logitech Hub, each app has a unique ID, this ID is not transferable to another instance of the application. Even when I upload a profile to my online Logitech profile when I download it back to my device, it can't assign it to the correct ID, so it stays in the Default profile.

@jackrobertscott
jackrobertscott / MonacoEditorReactHooks.ts
Created November 18, 2019 12:28
Microsoft monaco editor made with react hooks.
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'
import 'monaco-editor/esm/vs/language/css/monaco.contribution'
import 'monaco-editor/esm/vs/language/html/monaco.contribution'
import 'monaco-editor/esm/vs/language/json/monaco.contribution'
import 'monaco-editor/esm/vs/language/typescript/monaco.contribution'
import 'monaco-editor/esm/vs/basic-languages/monaco.contribution'
import { createElement as create, FC, useRef, useEffect } from 'react'
import { css } from 'emotion'
import { useTheme } from '../hooks/useTheme'
@gbere
gbere / install_less_on_ubuntu
Created June 18, 2013 16:50
install less on ubuntu
cd ~
sudo apt-get update
sudo apt-get install git-core curl build-essential openssl libssl-dev
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
node -v
sudo ln -s $HOME/node/ /usr/local/lib/node
@hungneox
hungneox / WIN10.MD
Last active May 1, 2024 15:53
How Make a Windows 10 USB Using Your Mac - Build a Bootable ISO From Your Mac's Terminal

Most new PCs don't come with DVD drives anymore. So it can be a pain to install Windows on a new computer.

Luckily, Microsoft makes a tool that you can use to install Windows from a USB storage drive (or "thumbdrive" as they are often called).

But what if you don't have a second PC for setting up that USB storage drive in the first place?

In this tutorial we'll show you how you can set this up from a Mac.

Step 1: Download the Windows 10 ISO file

You can download the ISO file straight from Windows. That's right - everything we're going to do here is 100% legal and sanctioned by Microsoft.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text to Image Translator</title>
<style>
/* Define CSS for character sprites */
.sprite {
background-image: url('sprite_sheet.png');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text to Image Translator</title>
<style>
/* Add any custom CSS styles here */
.char-image {
display: inline-block;
@kralicky
kralicky / harvester-gpu.md
Last active May 1, 2024 15:49
Harvester GPU Provisioning

Harvester GPU Provisioning

  1. Install Harvester, then SSH into the server.

  2. Edit /boot/grub/grub.cfg as follows:

 set default=0
 set timeout=10
 
@unitycoder
unitycoder / DrawBounds.cs
Last active May 1, 2024 15:49
Draw Bounds with Debug.DrawLine , Draw Box, Draw Runtime Gizmos
void DrawBounds(Bounds b, float delay=0)
{
// bottom
var p1 = new Vector3(b.min.x, b.min.y, b.min.z);
var p2 = new Vector3(b.max.x, b.min.y, b.min.z);
var p3 = new Vector3(b.max.x, b.min.y, b.max.z);
var p4 = new Vector3(b.min.x, b.min.y, b.max.z);
Debug.DrawLine(p1, p2, Color.blue, delay);
Debug.DrawLine(p2, p3, Color.red, delay);