Skip to content

Instantly share code, notes, and snippets.

View mcku's full-sized avatar

Mustafa Kuscu mcku

  • istanbul, istanbul
View GitHub Profile
term<-c("egypt","jordan","israel","saudi")
term_vec<-foreach(i=1:length(all_score_frames),.combine=rbind) %do%
{
score_row<-rep(0,length(term))
for(z in 1:length(score_row))
{
sel_score<-all_score_frames[[i]][all_score_frames[[i]]$term==term[z],"score"]
sel_score[is.na(sel_score)]<-0
if(length(sel_score)==0)
sel_score<-0
@mcku
mcku / react-onsenui.d.ts
Created October 17, 2016 08:08
a quick TS type definition for react-onsenui
// Generated by typings
// Source: src/vendor/react-onsenui.d.ts
declare module "react-onsenui" {
export default Ons;
namespace Ons {
import React = __React;
// <Icon />
type Modifier = 'material'|'default';
@mcku
mcku / gist:67ad237d21326169f63df2330d6ecde4
Created September 23, 2017 17:34
sensors-detect output
$sudo sensors-detect --auto
# sensors-detect revision $Revision$
# System: ASUSTeK COMPUTER INC. GL553VD [1.0] (laptop)
# Kernel: 4.12.13-1-ARCH x86_64
# Processor: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (6/158/9)
Running in automatic mode, default answers to all questions
are assumed.
Some south bridges, CPUs or memory controllers contain embedded sensors.
lspci -k
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 05)
Subsystem: ASUSTeK Computer Inc. Device 15e0
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 05)
Kernel driver in use: pcieport
Kernel modules: shpchp
00:02.0 VGA compatible controller: Intel Corporation Device 591b (rev 04)
Subsystem: ASUSTeK Computer Inc. Device 15e0
Kernel driver in use: i915
Kernel modules: i915
$ lsmod
Module Size Used by
coretemp 16384 0
hwmon_vid 16384 0
nls_utf8 16384 1
udf 90112 1
crc_itu_t 16384 1 udf
fuse 94208 3
ctr 16384 6
ccm 20480 9
@mcku
mcku / PKGBUILD
Last active June 13, 2018 10:28
yaourt guvenlik sorunu
pkgname=yaourt-script-security
pkgver=0.1
pkgrel=1
pkgdesc='yaourt acaba scriptlerimi calistiriyor mu'
arch=('any')
license=('BSD' 'GPL' 'LGPL' 'MIT')
url='http://www.google.com'
# burada tehlikeli bir komut da olabilirdi
echo acaba bu satiri da basacak mi
@mcku
mcku / test.log
Created November 13, 2018 08:08
scalajs-bundler test log
$ pwd
/Users/mustafakuscu/Sync/scalajs-bundler-example/play
$ sbt -Dplugin.version=0.14.0 clean compile test
[info] Loading settings from idea.sbt ...
[info] Loading global plugins from /Users/mustafakuscu/.sbt/1.0/plugins
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /Users/mustafakuscu/Sync/scalajs-bundler-example/scalajs-bundler/sbt-web-scalajs-bundler/src/sbt-test/sbt-web-scalajs-bundler/play/project
[info] Loading settings from build.sbt ...
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[info] Set current project to play (in build file:/Users/mustafakuscu/Sync/scalajs-bundler-example/scalajs-bundler/sbt-web-scalajs-bundler/src/sbt-test/sbt-web-scalajs-bundler/play/)
@mcku
mcku / dropdown-initialize.scala
Last active November 27, 2018 17:29
semantic-ui dropdown usage on binding.scala
/*
Auto-initializing semantic-ui dropdown
using DOM MutationObserver
*/
object SemanticUI {
@js.native
trait SemanticJQuery extends JQuery {
def dropdown(params: js.Any*): SemanticJQuery = js.native
}
@mcku
mcku / translations-udash-t.scala
Created November 27, 2018 18:57
a sample t function for translation
import com.thoughtworks.binding.{Binding, FutureBinding, dom}
import io.udash.i18n.{Bundle, Lang, LocalTranslationProvider, Translated, TranslationKey, TranslationKey0, TranslationKey1, TranslationKey2, TranslationProvider}
import scala.concurrent.Future
import scala.util.{Failure, Success, Try}
import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue
@mcku
mcku / appRender.scala
Created November 28, 2018 05:41
main single-page app routed render
@dom def render: Binding[Element] = {
// init
implicit val pageState: PageState = AppState.page.bind
//some actions here
//actions.action1()
//actions.action2()
val routePage: Page = Router.route.state.bind