Skip to content

Instantly share code, notes, and snippets.

View zosiu's full-sized avatar

Zsófia Balogh zosiu

  • 11:46 (UTC +02:00)
View GitHub Profile
@zosiu
zosiu / USomeBPLib.cpp
Created September 19, 2022 18:17 — forked from cgerchenhp/USomeBPLib.cpp
Apply color to nested array property rows. BlueprintCallable / Python Version
void RecursivelyFindChildrenWidgetsOfType(TSharedPtr<SWidget> Widget, FString WidgetType, TArray<TSharedPtr<SWidget>>& OutFindedChildrenWidgets)
{
if (!Widget.IsValid())
{
return;
}
FChildren* Children = Widget->GetChildren();
if (Children)
{
@zosiu
zosiu / api.rb
Created March 8, 2015 14:37
Grape setup with logging & documentation
module MyApp
module V1
class API < Grape::API
version 'v1', using: :path
format :json
before do
header['Access-Control-Allow-Origin'] = '*'
header['Access-Control-Request-Method'] = '*'
@zosiu
zosiu / note.rb
Created January 21, 2015 14:03
Association for polymorphic belongs_to of a particular type
class Note < ActiveRecord::Base
# The true polymorphic association
belongs_to :subject, polymorphic: true
# The trick to solve this problem
has_one :self_ref, class_name: self, foreign_key: :id
has_one :volunteer, through: :self_ref, source: :subject, source_type: Volunteer
has_one :participation, through: :self_ref, source: :subject, source_type: Participation
end
@zosiu
zosiu / Dockerfile
Created May 9, 2017 07:36 — forked from mjason/Dockerfile
build phoenix in docker
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y git wget curl build-essential
RUN wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && dpkg -i erlang-solutions_1.0_all.deb
RUN apt-get update
RUN apt-get install erlang -y
RUN apt-get install -y elixir
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
@zosiu
zosiu / critical_hit
Created December 5, 2015 01:08
Hipchat status change
#!/bin/bash
# usage: critical_hit HIPCHAT_API_KEY HIPCHAT_USER_ID_OR_EMAIL
(./set_hipchat_status $1 $2 dnd; sleep 2h; ./set_hipchat_status $1 $2 chat) &
@zosiu
zosiu / facebook_graph_api.rb
Last active January 10, 2017 16:23
Facebook Graph API w/ Koala
### app access token
graph = Koala::Facebook::OAuth.new APP_ID, APP_SECRET
graph.get_app_access_token # => APP_TOKEN
### create test users with permissions
test_users = Koala::Facebook::TestUsers.new app_id: APP_ID, secret: APP_SECRET
user = test_users.create true, 'email,user_birthday,user_posts', name: 'Bob'
# =>
# { "id" => USER_ID,
# "access_token" => USER_ACCESS_TOKEN,
@zosiu
zosiu / fake-s3-config.rb
Created August 26, 2016 09:50 — forked from ktopping/fake-s3-config.rb
fake s3 config
# Add the following to /etc/hosts:
127.0.0.1 local.s3.endpoint local-bucket.local.s3.endpoint
# Run the following in your rails console, in order to create a bucket:
s3=AWS::S3.new(
:access_key_id => 'anything',
:secret_access_key => 'anything',
:s3_endpoint => 'local.s3.endpoint',
:s3_port => 4567,
:use_ssl => false
@zosiu
zosiu / whiteboardCleaner.md
Created August 5, 2016 18:45 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

KC60 Keyboard end-user tips, tricks, programming notes, etc.

Leimi's note: removed lots of stuff from the original gist of scottjl, (thanks to him by the way!), as in the end some wasn't useful for me. If you are intestered, go check the gist revisions.

The KC60 is kinda like a premade GH60 that was first sold on Massdrop during summer 2015.
It runs on TMK firmware, or something based on it at least (not sure this is the real source for the keyboard but it seems it is), which means it's heavily programmable.
There is a GUI tool (the source of this tool seems to be here) and a command-line tool to ease up the process of programming the board.
**Go check this great article on Key

@zosiu
zosiu / xdg-open
Created December 5, 2013 21:06
Patched /usr/bin/xdg-open script for Lubuntu to open magnet and sublime links.
#!/bin/sh
#---------------------------------------------
# xdg-open
#
# Utility script to open a URL in the registered default application.
#
# Refer to the usage() function below for usage.
#
# Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org>
# Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org>