Skip to content

Instantly share code, notes, and snippets.

View X-Raym's full-sized avatar

Raymond Radet X-Raym

View GitHub Profile
@X-Raym
X-Raym / wavfile.py
Last active November 6, 2020 15:04 — forked from josephernest/wavfile.py
wavfile.py (enhanced): now moved to https://github.com/X-Raym/wavfile.py !!
# wavfile.py (Enhanced)
# Date: 20180430_2335 Joseph Basquin
#
# Mod by X-Raym
# Date: 20180706_1558
# * add log parameter for read function
# * return 'success' at end of write
# * renamed variables to avoid conflict with python native functions
# * correct bytes error
# * correct write function
@X-Raym
X-Raym / index.js
Created June 4, 2018 00:17
wavefile write cue point
var WaveFile = require('wavefile');
var fs = require('fs');
let wav = new WaveFile(fs.readFileSync("source.wav"))
console.log(wav.cue.dwCuePoints);
console.log(wav.cue.points);
wav.setCuePoint(5000, "YEAH");
let wavBuffer = wav.toBuffer();
fs.writeFile("source.wav", wavBuffer, function(err) {
if(err) {
return console.log(err);
@X-Raym
X-Raym / style.less
Created May 21, 2018 09:56
Atom Fountain Syntax Custom Style
.syntax--name.syntax--fountain {
color: #CCCCCC;
}
.syntax--dialogue.syntax--fountain {
color: #abb2bf;
}
.syntax--fountain .syntax--text {
color: #54b6ff;
@X-Raym
X-Raym / regex
Created May 17, 2018 13:27
Pigments atom colors code to json
(.+):(.+)
"$1": {\n\tcolor:$2\n},
@X-Raym
X-Raym / check_folder.py
Created May 1, 2018 18:32
Python script runnable with CLI and argument, or directly with input
import sys
import os
if __name__ == "__main__": # When the script is run
if len( sys.argv ) == 1: # Check if it was run with an argument
dir = input("Folder?\t") # If no, ask for user input
else:
dir = sys.argv[1] # Take first argument of the command
if os.path.isdir( dir ) == False: # Does the folder exists?
@X-Raym
X-Raym / script.js
Created April 2, 2018 09:56
Select first element of select form input and delete the others
$j(".ld-quiz-stats-all-select[data-type=quiz]").prop("selectedIndex", 0);
$j(".ld-quiz-stats-all-select[data-type=quiz] option").not(':first').remove();
@X-Raym
X-Raym / gist:41f00901f6e3fd6c678a2f2542ccd8f7
Created March 24, 2018 11:42
Windows with internet but no web pages
ipconfig /flushdns
netsh winsock reset
netsh winhttp reset proxy
netsh winhttp reset tracing
netsh winsock reset catalog
netsh int ipv4 reset catalog
netsh int ipv6 reset catalog
@X-Raym
X-Raym / wavesurfer.js
Created March 1, 2018 23:53
WaveSurfer.js 2.0.4
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("WaveSurfer", [], factory);
else if(typeof exports === 'object')
exports["WaveSurfer"] = factory();
else
root["WaveSurfer"] = factory();
})(typeof self !== 'undefined' ? self : this, function() {
@X-Raym
X-Raym / String Match with Captures Count.lua
Created January 26, 2018 14:58
String Match with Captures Count
text = [[reaper.ShowConsoleMsg( reaper.GetActiveTake( reaper.GetItem(0,0) ) ) )]]
local captures = {}
for capture in string.gmatch(text, "reaper%.([%w|%d]+)") do
if not captures[capture] then captures[capture] = 0 end
captures[capture] = captures[capture] + 1
end
for k, v in pairs( captures ) do
print( k .. " = " .. v)