Skip to content

Instantly share code, notes, and snippets.

View berezovskyi's full-sized avatar

Andrew Berezovskyi berezovskyi

View GitHub Profile
@berezovskyi
berezovskyi / sqlreset.sql
Last active March 21, 2023 07:59
this script cleans all views, SPS, functions PKs, FKs and tables. Author: http://stackoverflow.com/a/1473313/464590
/* Drop all non-system stored procs */
DECLARE @name VARCHAR(128)
DECLARE @SQL VARCHAR(254)
SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name])
WHILE @name is not null
BEGIN
SELECT @SQL = 'DROP PROCEDURE [dbo].[' + RTRIM(@name) +']'
EXEC (@SQL)
def itertar(tar):
while True:
n = tar.next()
if n is None:
break
else:
yield n
Are you sure you wish to upgrade from ruby-2.6.3 to ruby-2.7.0? (Y/n):
Installing new ruby ruby-2.7.0
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.7.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Error: Calling `brew list` to only list formulae is disabled! Use `brew list --formula` instead.
Error: Calling `brew list` to only list formulae is disabled! Use `brew list --formula` instead.
Error: Calling `brew list` to only list formulae is disabled! Use `brew list --formula` instead.
Error: Calling `brew list` to only list formulae is disabled! Use `brew list --formula` instead.
git clone git@github.com:eclipse/lyo.git
# we can also do https://www.hanselman.com/blog/easily-rename-your-git-default-branch-from-master-to-main here or at the end
git clone git@github.com:eclipse/lyo.domains.git
git tag v4.0.0.M2-domains 897c4bde35bddad08f7740eafb504771d7c4ac03
git remote add domains ../lyo.domains
git fetch domains --tags
git merge --allow-unrelated-histories domains/master
@berezovskyi
berezovskyi / do.sh
Created October 30, 2020 16:43
insert BSD license after XML preamble
sed '1a\
<!--\
Copyright (c) $YEAR $OWNER, All rights reserved.\
\
Redistribution and use in source and binary forms, with or without modification,\
are permitted provided that the following conditions are met:\
\
Redistributions of source code must retain the above copyright notice, this\
list of conditions and the following disclaimer. Redistributions in binary\
form must reproduce the above copyright notice, this list of conditions and\
@berezovskyi
berezovskyi / UnrecycleThem.cs
Created August 20, 2020 13:32 — forked from TJYSunset/UnrecycleThem.cs
This program restores all files in your recycle bin. I wrote this because explorer failed to restore too many files. It's tested on Windows 10, Chinese Simplified and must be edited to run properly on Windows of other languages.
using System;
using System.Runtime.InteropServices;
using Shell32;
namespace UnrecycleThem
{
public class UnrecycleThem
{
public static void Main(string[] args)
{
import org.apache.jena.rdf.listeners.ChangedListener
import org.apache.jena.rdf.model.InfModel
import org.apache.jena.rdf.model.Model
import org.apache.jena.rdf.model.ModelFactory
import org.apache.jena.reasoner.rulesys.RDFSRuleReasonerFactory
import org.apache.jena.riot.RDFDataMgr
import org.apache.jena.riot.RDFFormat
import org.apache.jena.util.FileUtils
import org.apache.jena.vocabulary.RDF
import org.apache.jena.vocabulary.ReasonerVocabulary

M590 introduction

AT serial commands

A successful connection is initialized in this way:

➟  sudo picocom -b 115200 /dev/ttyUSB0 
picocom v1.7
@berezovskyi
berezovskyi / import.scpt
Created February 18, 2018 19:44 — forked from shapiro125/import.scpt
Applescript: Import Apple Notes to Evernote
tell application "Notes"
set theMessages to every note
repeat with thisMessage in theMessages
# added identification of folder to create notebooks based on existing folder hierarchy
set myFolder to the container of thisMessage
@berezovskyi
berezovskyi / import.scpt
Created February 18, 2018 19:43 — forked from bzerangue/import.scpt
Applescript: Import Apple Notes to Evernote
tell application "Notes"
set theMessages to every note
repeat with thisMessage in theMessages
set myTitle to the name of thisMessage
set myText to the body of thisMessage