Skip to content

Instantly share code, notes, and snippets.

View roose's full-sized avatar
🐢
Looking for a job

roose roose

🐢
Looking for a job
View GitHub Profile
@roose
roose / index.js
Created October 10, 2023 12:47
Parse youtube history file
import fs from "fs";
const viewHistory = JSON.parse(fs.readFileSync("./data/view-history.json"));
function getVideosById(videos) {
let videosById = {};
videos.forEach((video) => {
let regex = /https:\/\/www\.youtube\.com\/watch\?v=(.*)/;
let title = video.title.substring(18).replace(/\s+/, " ");
@roose
roose / getsteamicons.ps1
Last active October 6, 2023 14:11
Repairing Steam Desktop Icons
$cdnUrl = "https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/apps/"
$steamFolder = (Get-Item HKCU:\Software\Valve\Steam).GetValue("SteamPath") + "/steam/games/"
# $steamFolder = "C:/Program Files (x86)/Steam/steam/games"
$desktopPath = [Environment]::GetFolderPath("Desktop")
$currentDirectory = $PWD
# Check if we have write access to $steamFolder
if (Test-Path -Path $steamFolder) {
try {
$testFile = Join-Path -Path $steamFolder -ChildPath "test.txt"
@roose
roose / bem_wp_menu.php
Created May 28, 2018 09:44
WordPress BEM Menu Walker
<?php
class Bem_Menu_Walker extends Walker_Nav_Menu {
/**
* Starts the list before the elements are added.
*
* @see Walker::start_lvl()
*
* @since 3.0.0
*
.menu {
&_item {
/**/
&-active {
.menu {
&_link {
/**/
a {
color: $blue;
}
@roose
roose / gulpfile.js
Last active September 6, 2016 11:51
var gulp = require('gulp');
var autoprefixer = require('autoprefixer-core');
var vars = require('postcss-simple-vars');
var colorFunction = require("postcss-color-function")
var $ = require('gulp-load-plugins')();
// errors handling and notify
var shitHappens = function(err) {
$.notify.onError("Error: <%= error.message %>")(err);
@cls
@doskey ls=ls --color $*
@doskey ..=cd ..
@doskey ...=cd ../..
@doskey ~=cd %userprofile%
@doskey e.=explorer .
@doskey hosts=subl %WINDIR%\System32\drivers\etc\hosts
@doskey ff="C:\Program Files (x86)\Mozilla Firefox\firefox.exe" $*
@doskey sudo=runas /user:User $*
@doskey new=%USERPROFILE%\new.bat $*
import os, osproc, parsecfg, streams, strutils, json, winlean
import wox, registry
var wp = newWox()
proc getSessions(): seq[string] =
result = @[]
let iniPath = joinPath(getConfigDir(), "winscp.ini")
[
{
"cat": "cities",
"name": "aktau.svg"
},
{
"cat": "cities",
"name": "almaty.svg"
},
{
@roose
roose / mozlz4a.py
Created April 11, 2016 13:15 — forked from Tblue/mozlz4a.py
MozLz4a compression/decompression utility
#!/usr/bin/env python
#
# Decompressor/compressor for files in Mozilla's "mozLz4" format. Firefox uses this file format to
# compress e. g. bookmark backups (*.jsonlz4).
#
# This file format is in fact just plain LZ4 data with a custom header (magic number [8 bytes] and
# uncompressed file size [4 bytes, little endian]).
#
# This Python 3 script requires the LZ4 bindings for Python, see: https://pypi.python.org/pypi/lz4
#